1#![doc = "MAVLink paparazzi dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[cfg(feature = "ts")]
21use ts_rs::TS;
22pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
23#[cfg_attr(feature = "ts", derive(TS))]
24#[cfg_attr(feature = "ts", ts(export))]
25#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
26#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27#[cfg_attr(feature = "serde", serde(tag = "type"))]
28#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29#[repr(u32)]
30#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
31pub enum ActuatorConfiguration {
32 #[doc = "Do nothing."]
33 ACTUATOR_CONFIGURATION_NONE = 0,
34 #[doc = "Command the actuator to beep now."]
35 ACTUATOR_CONFIGURATION_BEEP = 1,
36 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
37 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
38 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
40 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
41 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
44}
45impl ActuatorConfiguration {
46 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
47}
48impl Default for ActuatorConfiguration {
49 fn default() -> Self {
50 Self::DEFAULT
51 }
52}
53#[cfg_attr(feature = "ts", derive(TS))]
54#[cfg_attr(feature = "ts", ts(export))]
55#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
56#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
57#[cfg_attr(feature = "serde", serde(tag = "type"))]
58#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
59#[repr(u32)]
60#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
61pub enum ActuatorOutputFunction {
62 #[doc = "No function (disabled)."]
63 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
64 #[doc = "Motor 1"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
66 #[doc = "Motor 2"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
68 #[doc = "Motor 3"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
70 #[doc = "Motor 4"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
72 #[doc = "Motor 5"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
74 #[doc = "Motor 6"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
76 #[doc = "Motor 7"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
78 #[doc = "Motor 8"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
80 #[doc = "Motor 9"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
82 #[doc = "Motor 10"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
84 #[doc = "Motor 11"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
86 #[doc = "Motor 12"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
88 #[doc = "Motor 13"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
90 #[doc = "Motor 14"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
92 #[doc = "Motor 15"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
94 #[doc = "Motor 16"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
96 #[doc = "Servo 1"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
98 #[doc = "Servo 2"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
100 #[doc = "Servo 3"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
102 #[doc = "Servo 4"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
104 #[doc = "Servo 5"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
106 #[doc = "Servo 6"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
108 #[doc = "Servo 7"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
110 #[doc = "Servo 8"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
112 #[doc = "Servo 9"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
114 #[doc = "Servo 10"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
116 #[doc = "Servo 11"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
118 #[doc = "Servo 12"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
120 #[doc = "Servo 13"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
122 #[doc = "Servo 14"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
124 #[doc = "Servo 15"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
126 #[doc = "Servo 16"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
128}
129impl ActuatorOutputFunction {
130 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
131}
132impl Default for ActuatorOutputFunction {
133 fn default() -> Self {
134 Self::DEFAULT
135 }
136}
137#[cfg_attr(feature = "ts", derive(TS))]
138#[cfg_attr(feature = "ts", ts(export))]
139#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
141#[cfg_attr(feature = "serde", serde(tag = "type"))]
142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
143#[repr(u32)]
144#[doc = "Enumeration of the ADSB altimeter types"]
145pub enum AdsbAltitudeType {
146 #[doc = "Altitude reported from a Baro source using QNH reference"]
147 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
148 #[doc = "Altitude reported from a GNSS source"]
149 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
150}
151impl AdsbAltitudeType {
152 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
153}
154impl Default for AdsbAltitudeType {
155 fn default() -> Self {
156 Self::DEFAULT
157 }
158}
159#[cfg_attr(feature = "ts", derive(TS))]
160#[cfg_attr(feature = "ts", ts(export))]
161#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
163#[cfg_attr(feature = "serde", serde(tag = "type"))]
164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
165#[repr(u32)]
166#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
167pub enum AdsbEmitterType {
168 ADSB_EMITTER_TYPE_NO_INFO = 0,
169 ADSB_EMITTER_TYPE_LIGHT = 1,
170 ADSB_EMITTER_TYPE_SMALL = 2,
171 ADSB_EMITTER_TYPE_LARGE = 3,
172 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
173 ADSB_EMITTER_TYPE_HEAVY = 5,
174 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
175 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
176 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
177 ADSB_EMITTER_TYPE_GLIDER = 9,
178 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
179 ADSB_EMITTER_TYPE_PARACHUTE = 11,
180 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
181 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
182 ADSB_EMITTER_TYPE_UAV = 14,
183 ADSB_EMITTER_TYPE_SPACE = 15,
184 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
185 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
186 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
187 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
188}
189impl AdsbEmitterType {
190 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
191}
192impl Default for AdsbEmitterType {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
198impl AdsbFlags {
199 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
200}
201impl Default for AdsbFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
207impl AisFlags {
208 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
209}
210impl Default for AisFlags {
211 fn default() -> Self {
212 Self::DEFAULT
213 }
214}
215#[cfg_attr(feature = "ts", derive(TS))]
216#[cfg_attr(feature = "ts", ts(export))]
217#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
219#[cfg_attr(feature = "serde", serde(tag = "type"))]
220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
221#[repr(u32)]
222#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
223pub enum AisNavStatus {
224 #[doc = "Under way using engine."]
225 UNDER_WAY = 0,
226 AIS_NAV_ANCHORED = 1,
227 AIS_NAV_UN_COMMANDED = 2,
228 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
229 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
230 AIS_NAV_MOORED = 5,
231 AIS_NAV_AGROUND = 6,
232 AIS_NAV_FISHING = 7,
233 AIS_NAV_SAILING = 8,
234 AIS_NAV_RESERVED_HSC = 9,
235 AIS_NAV_RESERVED_WIG = 10,
236 AIS_NAV_RESERVED_1 = 11,
237 AIS_NAV_RESERVED_2 = 12,
238 AIS_NAV_RESERVED_3 = 13,
239 #[doc = "Search And Rescue Transponder."]
240 AIS_NAV_AIS_SART = 14,
241 #[doc = "Not available (default)."]
242 AIS_NAV_UNKNOWN = 15,
243}
244impl AisNavStatus {
245 pub const DEFAULT: Self = Self::UNDER_WAY;
246}
247impl Default for AisNavStatus {
248 fn default() -> Self {
249 Self::DEFAULT
250 }
251}
252#[cfg_attr(feature = "ts", derive(TS))]
253#[cfg_attr(feature = "ts", ts(export))]
254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
256#[cfg_attr(feature = "serde", serde(tag = "type"))]
257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
258#[repr(u32)]
259#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
260pub enum AisType {
261 #[doc = "Not available (default)."]
262 AIS_TYPE_UNKNOWN = 0,
263 AIS_TYPE_RESERVED_1 = 1,
264 AIS_TYPE_RESERVED_2 = 2,
265 AIS_TYPE_RESERVED_3 = 3,
266 AIS_TYPE_RESERVED_4 = 4,
267 AIS_TYPE_RESERVED_5 = 5,
268 AIS_TYPE_RESERVED_6 = 6,
269 AIS_TYPE_RESERVED_7 = 7,
270 AIS_TYPE_RESERVED_8 = 8,
271 AIS_TYPE_RESERVED_9 = 9,
272 AIS_TYPE_RESERVED_10 = 10,
273 AIS_TYPE_RESERVED_11 = 11,
274 AIS_TYPE_RESERVED_12 = 12,
275 AIS_TYPE_RESERVED_13 = 13,
276 AIS_TYPE_RESERVED_14 = 14,
277 AIS_TYPE_RESERVED_15 = 15,
278 AIS_TYPE_RESERVED_16 = 16,
279 AIS_TYPE_RESERVED_17 = 17,
280 AIS_TYPE_RESERVED_18 = 18,
281 AIS_TYPE_RESERVED_19 = 19,
282 #[doc = "Wing In Ground effect."]
283 AIS_TYPE_WIG = 20,
284 AIS_TYPE_WIG_HAZARDOUS_A = 21,
285 AIS_TYPE_WIG_HAZARDOUS_B = 22,
286 AIS_TYPE_WIG_HAZARDOUS_C = 23,
287 AIS_TYPE_WIG_HAZARDOUS_D = 24,
288 AIS_TYPE_WIG_RESERVED_1 = 25,
289 AIS_TYPE_WIG_RESERVED_2 = 26,
290 AIS_TYPE_WIG_RESERVED_3 = 27,
291 AIS_TYPE_WIG_RESERVED_4 = 28,
292 AIS_TYPE_WIG_RESERVED_5 = 29,
293 AIS_TYPE_FISHING = 30,
294 AIS_TYPE_TOWING = 31,
295 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
296 AIS_TYPE_TOWING_LARGE = 32,
297 #[doc = "Dredging or other underwater ops."]
298 AIS_TYPE_DREDGING = 33,
299 AIS_TYPE_DIVING = 34,
300 AIS_TYPE_MILITARY = 35,
301 AIS_TYPE_SAILING = 36,
302 AIS_TYPE_PLEASURE = 37,
303 AIS_TYPE_RESERVED_20 = 38,
304 AIS_TYPE_RESERVED_21 = 39,
305 #[doc = "High Speed Craft."]
306 AIS_TYPE_HSC = 40,
307 AIS_TYPE_HSC_HAZARDOUS_A = 41,
308 AIS_TYPE_HSC_HAZARDOUS_B = 42,
309 AIS_TYPE_HSC_HAZARDOUS_C = 43,
310 AIS_TYPE_HSC_HAZARDOUS_D = 44,
311 AIS_TYPE_HSC_RESERVED_1 = 45,
312 AIS_TYPE_HSC_RESERVED_2 = 46,
313 AIS_TYPE_HSC_RESERVED_3 = 47,
314 AIS_TYPE_HSC_RESERVED_4 = 48,
315 AIS_TYPE_HSC_UNKNOWN = 49,
316 AIS_TYPE_PILOT = 50,
317 #[doc = "Search And Rescue vessel."]
318 AIS_TYPE_SAR = 51,
319 AIS_TYPE_TUG = 52,
320 AIS_TYPE_PORT_TENDER = 53,
321 #[doc = "Anti-pollution equipment."]
322 AIS_TYPE_ANTI_POLLUTION = 54,
323 AIS_TYPE_LAW_ENFORCEMENT = 55,
324 AIS_TYPE_SPARE_LOCAL_1 = 56,
325 AIS_TYPE_SPARE_LOCAL_2 = 57,
326 AIS_TYPE_MEDICAL_TRANSPORT = 58,
327 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
328 AIS_TYPE_NONECOMBATANT = 59,
329 AIS_TYPE_PASSENGER = 60,
330 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
331 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
332 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
333 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
334 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
335 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
336 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
337 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
338 AIS_TYPE_PASSENGER_UNKNOWN = 69,
339 AIS_TYPE_CARGO = 70,
340 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
341 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
342 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
343 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
344 AIS_TYPE_CARGO_RESERVED_1 = 75,
345 AIS_TYPE_CARGO_RESERVED_2 = 76,
346 AIS_TYPE_CARGO_RESERVED_3 = 77,
347 AIS_TYPE_CARGO_RESERVED_4 = 78,
348 AIS_TYPE_CARGO_UNKNOWN = 79,
349 AIS_TYPE_TANKER = 80,
350 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
351 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
352 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
353 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
354 AIS_TYPE_TANKER_RESERVED_1 = 85,
355 AIS_TYPE_TANKER_RESERVED_2 = 86,
356 AIS_TYPE_TANKER_RESERVED_3 = 87,
357 AIS_TYPE_TANKER_RESERVED_4 = 88,
358 AIS_TYPE_TANKER_UNKNOWN = 89,
359 AIS_TYPE_OTHER = 90,
360 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
361 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
362 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
363 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
364 AIS_TYPE_OTHER_RESERVED_1 = 95,
365 AIS_TYPE_OTHER_RESERVED_2 = 96,
366 AIS_TYPE_OTHER_RESERVED_3 = 97,
367 AIS_TYPE_OTHER_RESERVED_4 = 98,
368 AIS_TYPE_OTHER_UNKNOWN = 99,
369}
370impl AisType {
371 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
372}
373impl Default for AisType {
374 fn default() -> Self {
375 Self::DEFAULT
376 }
377}
378bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
379impl AttitudeTargetTypemask {
380 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
381}
382impl Default for AttitudeTargetTypemask {
383 fn default() -> Self {
384 Self::DEFAULT
385 }
386}
387#[cfg_attr(feature = "ts", derive(TS))]
388#[cfg_attr(feature = "ts", ts(export))]
389#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
391#[cfg_attr(feature = "serde", serde(tag = "type"))]
392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
393#[repr(u32)]
394#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
395pub enum AutotuneAxis {
396 #[doc = "Autotune roll axis."]
397 AUTOTUNE_AXIS_ROLL = 1,
398 #[doc = "Autotune pitch axis."]
399 AUTOTUNE_AXIS_PITCH = 2,
400 #[doc = "Autotune yaw axis."]
401 AUTOTUNE_AXIS_YAW = 4,
402}
403impl AutotuneAxis {
404 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
405}
406impl Default for AutotuneAxis {
407 fn default() -> Self {
408 Self::DEFAULT
409 }
410}
411bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
412impl CameraCapFlags {
413 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
414}
415impl Default for CameraCapFlags {
416 fn default() -> Self {
417 Self::DEFAULT
418 }
419}
420#[cfg_attr(feature = "ts", derive(TS))]
421#[cfg_attr(feature = "ts", ts(export))]
422#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
424#[cfg_attr(feature = "serde", serde(tag = "type"))]
425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
426#[repr(u32)]
427#[doc = "Camera Modes."]
428pub enum CameraMode {
429 #[doc = "Camera is in image/photo capture mode."]
430 CAMERA_MODE_IMAGE = 0,
431 #[doc = "Camera is in video capture mode."]
432 CAMERA_MODE_VIDEO = 1,
433 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
434 CAMERA_MODE_IMAGE_SURVEY = 2,
435}
436impl CameraMode {
437 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
438}
439impl Default for CameraMode {
440 fn default() -> Self {
441 Self::DEFAULT
442 }
443}
444#[cfg_attr(feature = "ts", derive(TS))]
445#[cfg_attr(feature = "ts", ts(export))]
446#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
448#[cfg_attr(feature = "serde", serde(tag = "type"))]
449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
450#[repr(u32)]
451#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
452pub enum CameraSource {
453 #[doc = "Default camera source."]
454 CAMERA_SOURCE_DEFAULT = 0,
455 #[doc = "RGB camera source."]
456 CAMERA_SOURCE_RGB = 1,
457 #[doc = "IR camera source."]
458 CAMERA_SOURCE_IR = 2,
459 #[doc = "NDVI camera source."]
460 CAMERA_SOURCE_NDVI = 3,
461}
462impl CameraSource {
463 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
464}
465impl Default for CameraSource {
466 fn default() -> Self {
467 Self::DEFAULT
468 }
469}
470#[cfg_attr(feature = "ts", derive(TS))]
471#[cfg_attr(feature = "ts", ts(export))]
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking modes"]
478pub enum CameraTrackingMode {
479 #[doc = "Not tracking"]
480 CAMERA_TRACKING_MODE_NONE = 0,
481 #[doc = "Target is a point"]
482 CAMERA_TRACKING_MODE_POINT = 1,
483 #[doc = "Target is a rectangle"]
484 CAMERA_TRACKING_MODE_RECTANGLE = 2,
485}
486impl CameraTrackingMode {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
488}
489impl Default for CameraTrackingMode {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494#[cfg_attr(feature = "ts", derive(TS))]
495#[cfg_attr(feature = "ts", ts(export))]
496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
498#[cfg_attr(feature = "serde", serde(tag = "type"))]
499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
500#[repr(u32)]
501#[doc = "Camera tracking status flags"]
502pub enum CameraTrackingStatusFlags {
503 #[doc = "Camera is not tracking"]
504 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
505 #[doc = "Camera is tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
507 #[doc = "Camera tracking in error state"]
508 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
509}
510impl CameraTrackingStatusFlags {
511 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
512}
513impl Default for CameraTrackingStatusFlags {
514 fn default() -> Self {
515 Self::DEFAULT
516 }
517}
518bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
519impl CameraTrackingTargetData {
520 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
521}
522impl Default for CameraTrackingTargetData {
523 fn default() -> Self {
524 Self::DEFAULT
525 }
526}
527#[cfg_attr(feature = "ts", derive(TS))]
528#[cfg_attr(feature = "ts", ts(export))]
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
535pub enum CameraZoomType {
536 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
537 ZOOM_TYPE_STEP = 0,
538 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
539 ZOOM_TYPE_CONTINUOUS = 1,
540 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
541 ZOOM_TYPE_RANGE = 2,
542 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
543 ZOOM_TYPE_FOCAL_LENGTH = 3,
544 #[doc = "Zoom value as horizontal field of view in degrees."]
545 ZOOM_TYPE_HORIZONTAL_FOV = 4,
546}
547impl CameraZoomType {
548 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
549}
550impl Default for CameraZoomType {
551 fn default() -> Self {
552 Self::DEFAULT
553 }
554}
555#[cfg_attr(feature = "ts", derive(TS))]
556#[cfg_attr(feature = "ts", ts(export))]
557#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
559#[cfg_attr(feature = "serde", serde(tag = "type"))]
560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
561#[repr(u32)]
562pub enum CanFilterOp {
563 CAN_FILTER_REPLACE = 0,
564 CAN_FILTER_ADD = 1,
565 CAN_FILTER_REMOVE = 2,
566}
567impl CanFilterOp {
568 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
569}
570impl Default for CanFilterOp {
571 fn default() -> Self {
572 Self::DEFAULT
573 }
574}
575#[cfg_attr(feature = "ts", derive(TS))]
576#[cfg_attr(feature = "ts", ts(export))]
577#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
579#[cfg_attr(feature = "serde", serde(tag = "type"))]
580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
581#[repr(u32)]
582#[doc = "Possible responses from a CELLULAR_CONFIG message."]
583pub enum CellularConfigResponse {
584 #[doc = "Changes accepted."]
585 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
586 #[doc = "Invalid APN."]
587 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
588 #[doc = "Invalid PIN."]
589 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
590 #[doc = "Changes rejected."]
591 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
592 #[doc = "PUK is required to unblock SIM card."]
593 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
594}
595impl CellularConfigResponse {
596 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
597}
598impl Default for CellularConfigResponse {
599 fn default() -> Self {
600 Self::DEFAULT
601 }
602}
603#[cfg_attr(feature = "ts", derive(TS))]
604#[cfg_attr(feature = "ts", ts(export))]
605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
607#[cfg_attr(feature = "serde", serde(tag = "type"))]
608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
609#[repr(u32)]
610#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
611pub enum CellularNetworkFailedReason {
612 #[doc = "No error"]
613 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
614 #[doc = "Error state is unknown"]
615 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
616 #[doc = "SIM is required for the modem but missing"]
617 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
618 #[doc = "SIM is available, but not usable for connection"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
620}
621impl CellularNetworkFailedReason {
622 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
623}
624impl Default for CellularNetworkFailedReason {
625 fn default() -> Self {
626 Self::DEFAULT
627 }
628}
629#[cfg_attr(feature = "ts", derive(TS))]
630#[cfg_attr(feature = "ts", ts(export))]
631#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
633#[cfg_attr(feature = "serde", serde(tag = "type"))]
634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
635#[repr(u32)]
636#[doc = "Cellular network radio type"]
637pub enum CellularNetworkRadioType {
638 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
639 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
640 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
641 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
642 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
643}
644impl CellularNetworkRadioType {
645 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
646}
647impl Default for CellularNetworkRadioType {
648 fn default() -> Self {
649 Self::DEFAULT
650 }
651}
652#[cfg_attr(feature = "ts", derive(TS))]
653#[cfg_attr(feature = "ts", ts(export))]
654#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
656#[cfg_attr(feature = "serde", serde(tag = "type"))]
657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
658#[repr(u32)]
659#[doc = "These flags encode the cellular network status"]
660pub enum CellularStatusFlag {
661 #[doc = "State unknown or not reportable."]
662 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
663 #[doc = "Modem is unusable"]
664 CELLULAR_STATUS_FLAG_FAILED = 1,
665 #[doc = "Modem is being initialized"]
666 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
667 #[doc = "Modem is locked"]
668 CELLULAR_STATUS_FLAG_LOCKED = 3,
669 #[doc = "Modem is not enabled and is powered down"]
670 CELLULAR_STATUS_FLAG_DISABLED = 4,
671 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
672 CELLULAR_STATUS_FLAG_DISABLING = 5,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
674 CELLULAR_STATUS_FLAG_ENABLING = 6,
675 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
676 CELLULAR_STATUS_FLAG_ENABLED = 7,
677 #[doc = "Modem is searching for a network provider to register"]
678 CELLULAR_STATUS_FLAG_SEARCHING = 8,
679 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
680 CELLULAR_STATUS_FLAG_REGISTERED = 9,
681 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
682 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
683 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
684 CELLULAR_STATUS_FLAG_CONNECTING = 11,
685 #[doc = "One or more packet data bearers is active and connected"]
686 CELLULAR_STATUS_FLAG_CONNECTED = 12,
687}
688impl CellularStatusFlag {
689 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
690}
691impl Default for CellularStatusFlag {
692 fn default() -> Self {
693 Self::DEFAULT
694 }
695}
696#[cfg_attr(feature = "ts", derive(TS))]
697#[cfg_attr(feature = "ts", ts(export))]
698#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
700#[cfg_attr(feature = "serde", serde(tag = "type"))]
701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
702#[repr(u32)]
703#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
704pub enum CompMetadataType {
705 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
706 COMP_METADATA_TYPE_GENERAL = 0,
707 #[doc = "Parameter meta data."]
708 COMP_METADATA_TYPE_PARAMETER = 1,
709 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
710 COMP_METADATA_TYPE_COMMANDS = 2,
711 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
712 COMP_METADATA_TYPE_PERIPHERALS = 3,
713 #[doc = "Meta data for the events interface."]
714 COMP_METADATA_TYPE_EVENTS = 4,
715 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
716 COMP_METADATA_TYPE_ACTUATORS = 5,
717}
718impl CompMetadataType {
719 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
720}
721impl Default for CompMetadataType {
722 fn default() -> Self {
723 Self::DEFAULT
724 }
725}
726#[cfg_attr(feature = "ts", derive(TS))]
727#[cfg_attr(feature = "ts", ts(export))]
728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
730#[cfg_attr(feature = "serde", serde(tag = "type"))]
731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
732#[repr(u32)]
733#[doc = "Indicates the ESC connection type."]
734pub enum EscConnectionType {
735 #[doc = "Traditional PPM ESC."]
736 ESC_CONNECTION_TYPE_PPM = 0,
737 #[doc = "Serial Bus connected ESC."]
738 ESC_CONNECTION_TYPE_SERIAL = 1,
739 #[doc = "One Shot PPM ESC."]
740 ESC_CONNECTION_TYPE_ONESHOT = 2,
741 #[doc = "I2C ESC."]
742 ESC_CONNECTION_TYPE_I2C = 3,
743 #[doc = "CAN-Bus ESC."]
744 ESC_CONNECTION_TYPE_CAN = 4,
745 #[doc = "DShot ESC."]
746 ESC_CONNECTION_TYPE_DSHOT = 5,
747}
748impl EscConnectionType {
749 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
750}
751impl Default for EscConnectionType {
752 fn default() -> Self {
753 Self::DEFAULT
754 }
755}
756bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
757impl EscFailureFlags {
758 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
759}
760impl Default for EscFailureFlags {
761 fn default() -> Self {
762 Self::DEFAULT
763 }
764}
765bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
766impl EstimatorStatusFlags {
767 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
768}
769impl Default for EstimatorStatusFlags {
770 fn default() -> Self {
771 Self::DEFAULT
772 }
773}
774#[cfg_attr(feature = "ts", derive(TS))]
775#[cfg_attr(feature = "ts", ts(export))]
776#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
778#[cfg_attr(feature = "serde", serde(tag = "type"))]
779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
780#[repr(u32)]
781#[doc = "List of possible failure type to inject."]
782pub enum FailureType {
783 #[doc = "No failure injected, used to reset a previous failure."]
784 FAILURE_TYPE_OK = 0,
785 #[doc = "Sets unit off, so completely non-responsive."]
786 FAILURE_TYPE_OFF = 1,
787 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
788 FAILURE_TYPE_STUCK = 2,
789 #[doc = "Unit is reporting complete garbage."]
790 FAILURE_TYPE_GARBAGE = 3,
791 #[doc = "Unit is consistently wrong."]
792 FAILURE_TYPE_WRONG = 4,
793 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
794 FAILURE_TYPE_SLOW = 5,
795 #[doc = "Data of unit is delayed in time."]
796 FAILURE_TYPE_DELAYED = 6,
797 #[doc = "Unit is sometimes working, sometimes not."]
798 FAILURE_TYPE_INTERMITTENT = 7,
799}
800impl FailureType {
801 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
802}
803impl Default for FailureType {
804 fn default() -> Self {
805 Self::DEFAULT
806 }
807}
808#[cfg_attr(feature = "ts", derive(TS))]
809#[cfg_attr(feature = "ts", ts(export))]
810#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
812#[cfg_attr(feature = "serde", serde(tag = "type"))]
813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
814#[repr(u32)]
815#[doc = "List of possible units where failures can be injected."]
816pub enum FailureUnit {
817 FAILURE_UNIT_SENSOR_GYRO = 0,
818 FAILURE_UNIT_SENSOR_ACCEL = 1,
819 FAILURE_UNIT_SENSOR_MAG = 2,
820 FAILURE_UNIT_SENSOR_BARO = 3,
821 FAILURE_UNIT_SENSOR_GPS = 4,
822 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
823 FAILURE_UNIT_SENSOR_VIO = 6,
824 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
825 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
826 FAILURE_UNIT_SYSTEM_BATTERY = 100,
827 FAILURE_UNIT_SYSTEM_MOTOR = 101,
828 FAILURE_UNIT_SYSTEM_SERVO = 102,
829 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
830 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
831 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
832}
833impl FailureUnit {
834 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
835}
836impl Default for FailureUnit {
837 fn default() -> Self {
838 Self::DEFAULT
839 }
840}
841#[cfg_attr(feature = "ts", derive(TS))]
842#[cfg_attr(feature = "ts", ts(export))]
843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
845#[cfg_attr(feature = "serde", serde(tag = "type"))]
846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
847#[repr(u32)]
848pub enum FenceBreach {
849 #[doc = "No last fence breach"]
850 FENCE_BREACH_NONE = 0,
851 #[doc = "Breached minimum altitude"]
852 FENCE_BREACH_MINALT = 1,
853 #[doc = "Breached maximum altitude"]
854 FENCE_BREACH_MAXALT = 2,
855 #[doc = "Breached fence boundary"]
856 FENCE_BREACH_BOUNDARY = 3,
857}
858impl FenceBreach {
859 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
860}
861impl Default for FenceBreach {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[cfg_attr(feature = "ts", derive(TS))]
867#[cfg_attr(feature = "ts", ts(export))]
868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
870#[cfg_attr(feature = "serde", serde(tag = "type"))]
871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
872#[repr(u32)]
873#[doc = "Actions being taken to mitigate/prevent fence breach"]
874pub enum FenceMitigate {
875 #[doc = "Unknown"]
876 FENCE_MITIGATE_UNKNOWN = 0,
877 #[doc = "No actions being taken"]
878 FENCE_MITIGATE_NONE = 1,
879 #[doc = "Velocity limiting active to prevent breach"]
880 FENCE_MITIGATE_VEL_LIMIT = 2,
881}
882impl FenceMitigate {
883 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
884}
885impl Default for FenceMitigate {
886 fn default() -> Self {
887 Self::DEFAULT
888 }
889}
890#[cfg_attr(feature = "ts", derive(TS))]
891#[cfg_attr(feature = "ts", ts(export))]
892#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
894#[cfg_attr(feature = "serde", serde(tag = "type"))]
895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
896#[repr(u32)]
897#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
898pub enum FenceType {
899 #[doc = "Maximum altitude fence"]
900 FENCE_TYPE_ALT_MAX = 1,
901 #[doc = "Circle fence"]
902 FENCE_TYPE_CIRCLE = 2,
903 #[doc = "Polygon fence"]
904 FENCE_TYPE_POLYGON = 4,
905 #[doc = "Minimum altitude fence"]
906 FENCE_TYPE_ALT_MIN = 8,
907}
908impl FenceType {
909 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
910}
911impl Default for FenceType {
912 fn default() -> Self {
913 Self::DEFAULT
914 }
915}
916#[cfg_attr(feature = "ts", derive(TS))]
917#[cfg_attr(feature = "ts", ts(export))]
918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
920#[cfg_attr(feature = "serde", serde(tag = "type"))]
921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
922#[repr(u32)]
923#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
924pub enum FirmwareVersionType {
925 #[doc = "development release"]
926 FIRMWARE_VERSION_TYPE_DEV = 0,
927 #[doc = "alpha release"]
928 FIRMWARE_VERSION_TYPE_ALPHA = 64,
929 #[doc = "beta release"]
930 FIRMWARE_VERSION_TYPE_BETA = 128,
931 #[doc = "release candidate"]
932 FIRMWARE_VERSION_TYPE_RC = 192,
933 #[doc = "official stable release"]
934 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
935}
936impl FirmwareVersionType {
937 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
938}
939impl Default for FirmwareVersionType {
940 fn default() -> Self {
941 Self::DEFAULT
942 }
943}
944bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
945impl GimbalDeviceCapFlags {
946 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
947}
948impl Default for GimbalDeviceCapFlags {
949 fn default() -> Self {
950 Self::DEFAULT
951 }
952}
953bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
954impl GimbalDeviceErrorFlags {
955 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
956}
957impl Default for GimbalDeviceErrorFlags {
958 fn default() -> Self {
959 Self::DEFAULT
960 }
961}
962bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
963impl GimbalDeviceFlags {
964 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
965}
966impl Default for GimbalDeviceFlags {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
972impl GimbalManagerCapFlags {
973 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
974}
975impl Default for GimbalManagerCapFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
981impl GimbalManagerFlags {
982 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
983}
984impl Default for GimbalManagerFlags {
985 fn default() -> Self {
986 Self::DEFAULT
987 }
988}
989#[cfg_attr(feature = "ts", derive(TS))]
990#[cfg_attr(feature = "ts", ts(export))]
991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
993#[cfg_attr(feature = "serde", serde(tag = "type"))]
994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
995#[repr(u32)]
996#[doc = "Type of GPS fix"]
997pub enum GpsFixType {
998 #[doc = "No GPS connected"]
999 GPS_FIX_TYPE_NO_GPS = 0,
1000 #[doc = "No position information, GPS is connected"]
1001 GPS_FIX_TYPE_NO_FIX = 1,
1002 #[doc = "2D position"]
1003 GPS_FIX_TYPE_2D_FIX = 2,
1004 #[doc = "3D position"]
1005 GPS_FIX_TYPE_3D_FIX = 3,
1006 #[doc = "DGPS/SBAS aided 3D position"]
1007 GPS_FIX_TYPE_DGPS = 4,
1008 #[doc = "RTK float, 3D position"]
1009 GPS_FIX_TYPE_RTK_FLOAT = 5,
1010 #[doc = "RTK Fixed, 3D position"]
1011 GPS_FIX_TYPE_RTK_FIXED = 6,
1012 #[doc = "Static fixed, typically used for base stations"]
1013 GPS_FIX_TYPE_STATIC = 7,
1014 #[doc = "PPP, 3D position."]
1015 GPS_FIX_TYPE_PPP = 8,
1016}
1017impl GpsFixType {
1018 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1019}
1020impl Default for GpsFixType {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1026impl GpsInputIgnoreFlags {
1027 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1028}
1029impl Default for GpsInputIgnoreFlags {
1030 fn default() -> Self {
1031 Self::DEFAULT
1032 }
1033}
1034#[cfg_attr(feature = "ts", derive(TS))]
1035#[cfg_attr(feature = "ts", ts(export))]
1036#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1038#[cfg_attr(feature = "serde", serde(tag = "type"))]
1039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1040#[repr(u32)]
1041#[doc = "Gripper actions."]
1042pub enum GripperActions {
1043 #[doc = "Gripper release cargo."]
1044 GRIPPER_ACTION_RELEASE = 0,
1045 #[doc = "Gripper grab onto cargo."]
1046 GRIPPER_ACTION_GRAB = 1,
1047}
1048impl GripperActions {
1049 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1050}
1051impl Default for GripperActions {
1052 fn default() -> Self {
1053 Self::DEFAULT
1054 }
1055}
1056bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1057impl HighresImuUpdatedFlags {
1058 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1059}
1060impl Default for HighresImuUpdatedFlags {
1061 fn default() -> Self {
1062 Self::DEFAULT
1063 }
1064}
1065bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1066impl HilActuatorControlsFlags {
1067 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1068}
1069impl Default for HilActuatorControlsFlags {
1070 fn default() -> Self {
1071 Self::DEFAULT
1072 }
1073}
1074bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1075impl HilSensorUpdatedFlags {
1076 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1077}
1078impl Default for HilSensorUpdatedFlags {
1079 fn default() -> Self {
1080 Self::DEFAULT
1081 }
1082}
1083bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1084impl HlFailureFlag {
1085 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1086}
1087impl Default for HlFailureFlag {
1088 fn default() -> Self {
1089 Self::DEFAULT
1090 }
1091}
1092bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1093impl IlluminatorErrorFlags {
1094 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1095}
1096impl Default for IlluminatorErrorFlags {
1097 fn default() -> Self {
1098 Self::DEFAULT
1099 }
1100}
1101#[cfg_attr(feature = "ts", derive(TS))]
1102#[cfg_attr(feature = "ts", ts(export))]
1103#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1105#[cfg_attr(feature = "serde", serde(tag = "type"))]
1106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1107#[repr(u32)]
1108#[doc = "Modes of illuminator"]
1109pub enum IlluminatorMode {
1110 #[doc = "Illuminator mode is not specified/unknown"]
1111 ILLUMINATOR_MODE_UNKNOWN = 0,
1112 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1113 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1114 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1115 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1116}
1117impl IlluminatorMode {
1118 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1119}
1120impl Default for IlluminatorMode {
1121 fn default() -> Self {
1122 Self::DEFAULT
1123 }
1124}
1125#[cfg_attr(feature = "ts", derive(TS))]
1126#[cfg_attr(feature = "ts", ts(export))]
1127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1129#[cfg_attr(feature = "serde", serde(tag = "type"))]
1130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1131#[repr(u32)]
1132#[doc = "Type of landing target"]
1133pub enum LandingTargetType {
1134 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1135 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1136 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1137 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1138 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1139 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1140 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1141 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1142}
1143impl LandingTargetType {
1144 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1145}
1146impl Default for LandingTargetType {
1147 fn default() -> Self {
1148 Self::DEFAULT
1149 }
1150}
1151#[cfg_attr(feature = "ts", derive(TS))]
1152#[cfg_attr(feature = "ts", ts(export))]
1153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1155#[cfg_attr(feature = "serde", serde(tag = "type"))]
1156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1157#[repr(u32)]
1158pub enum MagCalStatus {
1159 MAG_CAL_NOT_STARTED = 0,
1160 MAG_CAL_WAITING_TO_START = 1,
1161 MAG_CAL_RUNNING_STEP_ONE = 2,
1162 MAG_CAL_RUNNING_STEP_TWO = 3,
1163 MAG_CAL_SUCCESS = 4,
1164 MAG_CAL_FAILED = 5,
1165 MAG_CAL_BAD_ORIENTATION = 6,
1166 MAG_CAL_BAD_RADIUS = 7,
1167}
1168impl MagCalStatus {
1169 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1170}
1171impl Default for MagCalStatus {
1172 fn default() -> Self {
1173 Self::DEFAULT
1174 }
1175}
1176#[cfg_attr(feature = "ts", derive(TS))]
1177#[cfg_attr(feature = "ts", ts(export))]
1178#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1180#[cfg_attr(feature = "serde", serde(tag = "type"))]
1181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1182#[repr(u32)]
1183pub enum MavArmAuthDeniedReason {
1184 #[doc = "Not a specific reason"]
1185 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1186 #[doc = "Authorizer will send the error as string to GCS"]
1187 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1188 #[doc = "At least one waypoint have a invalid value"]
1189 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1190 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1191 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1192 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1193 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1194 #[doc = "Weather is not good to fly"]
1195 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1196}
1197impl MavArmAuthDeniedReason {
1198 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1199}
1200impl Default for MavArmAuthDeniedReason {
1201 fn default() -> Self {
1202 Self::DEFAULT
1203 }
1204}
1205#[cfg_attr(feature = "ts", derive(TS))]
1206#[cfg_attr(feature = "ts", ts(export))]
1207#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1209#[cfg_attr(feature = "serde", serde(tag = "type"))]
1210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1211#[repr(u32)]
1212#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1213pub enum MavAutopilot {
1214 #[doc = "Generic autopilot, full support for everything"]
1215 MAV_AUTOPILOT_GENERIC = 0,
1216 #[doc = "Reserved for future use."]
1217 MAV_AUTOPILOT_RESERVED = 1,
1218 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1219 MAV_AUTOPILOT_SLUGS = 2,
1220 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1221 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1222 #[doc = "OpenPilot, <http://openpilot.org>"]
1223 MAV_AUTOPILOT_OPENPILOT = 4,
1224 #[doc = "Generic autopilot only supporting simple waypoints"]
1225 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1226 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1228 #[doc = "Generic autopilot supporting the full mission command set"]
1229 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1230 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1231 MAV_AUTOPILOT_INVALID = 8,
1232 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1233 MAV_AUTOPILOT_PPZ = 9,
1234 #[doc = "UAV Dev Board"]
1235 MAV_AUTOPILOT_UDB = 10,
1236 #[doc = "FlexiPilot"]
1237 MAV_AUTOPILOT_FP = 11,
1238 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1239 MAV_AUTOPILOT_PX4 = 12,
1240 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1241 MAV_AUTOPILOT_SMACCMPILOT = 13,
1242 #[doc = "AutoQuad -- <http://autoquad.org>"]
1243 MAV_AUTOPILOT_AUTOQUAD = 14,
1244 #[doc = "Armazila -- <http://armazila.com>"]
1245 MAV_AUTOPILOT_ARMAZILA = 15,
1246 #[doc = "Aerob -- <http://aerob.ru>"]
1247 MAV_AUTOPILOT_AEROB = 16,
1248 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1249 MAV_AUTOPILOT_ASLUAV = 17,
1250 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1251 MAV_AUTOPILOT_SMARTAP = 18,
1252 #[doc = "AirRails - <http://uaventure.com>"]
1253 MAV_AUTOPILOT_AIRRAILS = 19,
1254 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1255 MAV_AUTOPILOT_REFLEX = 20,
1256}
1257impl MavAutopilot {
1258 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1259}
1260impl Default for MavAutopilot {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[cfg_attr(feature = "ts", derive(TS))]
1266#[cfg_attr(feature = "ts", ts(export))]
1267#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1269#[cfg_attr(feature = "serde", serde(tag = "type"))]
1270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1271#[repr(u32)]
1272#[doc = "Enumeration for battery charge states."]
1273pub enum MavBatteryChargeState {
1274 #[doc = "Low battery state is not provided"]
1275 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1276 #[doc = "Battery is not in low state. Normal operation."]
1277 MAV_BATTERY_CHARGE_STATE_OK = 1,
1278 #[doc = "Battery state is low, warn and monitor close."]
1279 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1280 #[doc = "Battery state is critical, return or abort immediately."]
1281 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1282 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1283 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1284 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1285 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1286 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1288 #[doc = "Battery is charging."]
1289 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1290}
1291impl MavBatteryChargeState {
1292 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1293}
1294impl Default for MavBatteryChargeState {
1295 fn default() -> Self {
1296 Self::DEFAULT
1297 }
1298}
1299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1300impl MavBatteryFault {
1301 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1302}
1303impl Default for MavBatteryFault {
1304 fn default() -> Self {
1305 Self::DEFAULT
1306 }
1307}
1308#[cfg_attr(feature = "ts", derive(TS))]
1309#[cfg_attr(feature = "ts", ts(export))]
1310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1312#[cfg_attr(feature = "serde", serde(tag = "type"))]
1313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1314#[repr(u32)]
1315#[doc = "Enumeration of battery functions"]
1316pub enum MavBatteryFunction {
1317 #[doc = "Battery function is unknown"]
1318 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1319 #[doc = "Battery supports all flight systems"]
1320 MAV_BATTERY_FUNCTION_ALL = 1,
1321 #[doc = "Battery for the propulsion system"]
1322 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1323 #[doc = "Avionics battery"]
1324 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1325 #[doc = "Payload battery"]
1326 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1327}
1328impl MavBatteryFunction {
1329 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1330}
1331impl Default for MavBatteryFunction {
1332 fn default() -> Self {
1333 Self::DEFAULT
1334 }
1335}
1336#[cfg_attr(feature = "ts", derive(TS))]
1337#[cfg_attr(feature = "ts", ts(export))]
1338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1340#[cfg_attr(feature = "serde", serde(tag = "type"))]
1341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1342#[repr(u32)]
1343#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1344pub enum MavBatteryMode {
1345 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1346 MAV_BATTERY_MODE_UNKNOWN = 0,
1347 #[doc = "Battery is auto discharging (towards storage level)."]
1348 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1349 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1350 MAV_BATTERY_MODE_HOT_SWAP = 2,
1351}
1352impl MavBatteryMode {
1353 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1354}
1355impl Default for MavBatteryMode {
1356 fn default() -> Self {
1357 Self::DEFAULT
1358 }
1359}
1360#[cfg_attr(feature = "ts", derive(TS))]
1361#[cfg_attr(feature = "ts", ts(export))]
1362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1364#[cfg_attr(feature = "serde", serde(tag = "type"))]
1365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1366#[repr(u32)]
1367#[doc = "Enumeration of battery types"]
1368pub enum MavBatteryType {
1369 #[doc = "Not specified."]
1370 MAV_BATTERY_TYPE_UNKNOWN = 0,
1371 #[doc = "Lithium polymer battery"]
1372 MAV_BATTERY_TYPE_LIPO = 1,
1373 #[doc = "Lithium-iron-phosphate battery"]
1374 MAV_BATTERY_TYPE_LIFE = 2,
1375 #[doc = "Lithium-ION battery"]
1376 MAV_BATTERY_TYPE_LION = 3,
1377 #[doc = "Nickel metal hydride battery"]
1378 MAV_BATTERY_TYPE_NIMH = 4,
1379}
1380impl MavBatteryType {
1381 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1382}
1383impl Default for MavBatteryType {
1384 fn default() -> Self {
1385 Self::DEFAULT
1386 }
1387}
1388#[cfg_attr(feature = "ts", derive(TS))]
1389#[cfg_attr(feature = "ts", ts(export))]
1390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1392#[cfg_attr(feature = "serde", serde(tag = "type"))]
1393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1394#[repr(u32)]
1395#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1396pub enum MavCmd {
1397 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1398 MAV_CMD_NAV_WAYPOINT = 16,
1399 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1400 MAV_CMD_NAV_LOITER_UNLIM = 17,
1401 #[doc = "Loiter around this waypoint for X turns"]
1402 MAV_CMD_NAV_LOITER_TURNS = 18,
1403 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1404 MAV_CMD_NAV_LOITER_TIME = 19,
1405 #[doc = "Return to launch location"]
1406 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1407 #[doc = "Land at location."]
1408 MAV_CMD_NAV_LAND = 21,
1409 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1410 MAV_CMD_NAV_TAKEOFF = 22,
1411 #[doc = "Land at local position (local frame only)"]
1412 MAV_CMD_NAV_LAND_LOCAL = 23,
1413 #[doc = "Takeoff from local position (local frame only)"]
1414 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1415 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1416 MAV_CMD_NAV_FOLLOW = 25,
1417 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1418 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1419 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1420 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1421 #[doc = "Begin following a target"]
1422 MAV_CMD_DO_FOLLOW = 32,
1423 #[doc = "Reposition the MAV after a follow target command has been sent"]
1424 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1425 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1426 MAV_CMD_DO_ORBIT = 34,
1427 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1428 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1429 MAV_CMD_NAV_ROI = 80,
1430 #[doc = "Control autonomous path planning on the MAV."]
1431 MAV_CMD_NAV_PATHPLANNING = 81,
1432 #[doc = "Navigate to waypoint using a spline path."]
1433 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1434 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1435 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1436 #[doc = "Land using VTOL mode"]
1437 MAV_CMD_NAV_VTOL_LAND = 85,
1438 #[doc = "hand control over to an external controller"]
1439 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1440 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1441 MAV_CMD_NAV_DELAY = 93,
1442 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1443 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1444 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1445 MAV_CMD_NAV_LAST = 95,
1446 #[doc = "Delay mission state machine."]
1447 MAV_CMD_CONDITION_DELAY = 112,
1448 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1449 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1450 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1451 MAV_CMD_CONDITION_DISTANCE = 114,
1452 #[doc = "Reach a certain target angle."]
1453 MAV_CMD_CONDITION_YAW = 115,
1454 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1455 MAV_CMD_CONDITION_LAST = 159,
1456 #[doc = "Set system mode."]
1457 MAV_CMD_DO_SET_MODE = 176,
1458 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1459 MAV_CMD_DO_JUMP = 177,
1460 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1461 MAV_CMD_DO_CHANGE_SPEED = 178,
1462 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1463 MAV_CMD_DO_SET_HOME = 179,
1464 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1465 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1466 MAV_CMD_DO_SET_PARAMETER = 180,
1467 #[doc = "Set a relay to a condition."]
1468 MAV_CMD_DO_SET_RELAY = 181,
1469 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1470 MAV_CMD_DO_REPEAT_RELAY = 182,
1471 #[doc = "Set a servo to a desired PWM value."]
1472 MAV_CMD_DO_SET_SERVO = 183,
1473 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1474 MAV_CMD_DO_REPEAT_SERVO = 184,
1475 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1476 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1477 #[doc = "Change altitude set point."]
1478 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1479 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1480 MAV_CMD_DO_SET_ACTUATOR = 187,
1481 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1482 MAV_CMD_DO_RETURN_PATH_START = 188,
1483 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1484 MAV_CMD_DO_LAND_START = 189,
1485 #[doc = "Mission command to perform a landing from a rally point."]
1486 MAV_CMD_DO_RALLY_LAND = 190,
1487 #[doc = "Mission command to safely abort an autonomous landing."]
1488 MAV_CMD_DO_GO_AROUND = 191,
1489 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1490 MAV_CMD_DO_REPOSITION = 192,
1491 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1492 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1493 #[doc = "Set moving direction to forward or reverse."]
1494 MAV_CMD_DO_SET_REVERSE = 194,
1495 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1496 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1497 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1499 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1500 MAV_CMD_DO_SET_ROI_NONE = 197,
1501 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1502 MAV_CMD_DO_SET_ROI_SYSID = 198,
1503 #[doc = "Control onboard camera system."]
1504 MAV_CMD_DO_CONTROL_VIDEO = 200,
1505 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1506 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1507 MAV_CMD_DO_SET_ROI = 201,
1508 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1509 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1510 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1512 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1513 #[doc = "Mission command to configure a camera or antenna mount"]
1514 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1515 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1516 #[doc = "Mission command to control a camera or antenna mount"]
1517 MAV_CMD_DO_MOUNT_CONTROL = 205,
1518 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1519 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1520 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1521 MAV_CMD_DO_FENCE_ENABLE = 207,
1522 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1523 MAV_CMD_DO_PARACHUTE = 208,
1524 #[doc = "Command to perform motor test."]
1525 MAV_CMD_DO_MOTOR_TEST = 209,
1526 #[doc = "Change to/from inverted flight."]
1527 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1528 #[doc = "Mission command to operate a gripper."]
1529 MAV_CMD_DO_GRIPPER = 211,
1530 #[doc = "Enable/disable autotune."]
1531 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1532 #[doc = "Sets a desired vehicle turn angle and speed change."]
1533 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1534 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1535 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1536 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1537 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1538 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1539 #[doc = "set id of master controller"]
1540 MAV_CMD_DO_GUIDED_MASTER = 221,
1541 #[doc = "Set limits for external control"]
1542 MAV_CMD_DO_GUIDED_LIMITS = 222,
1543 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1544 MAV_CMD_DO_ENGINE_CONTROL = 223,
1545 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1546 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1547 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1548 MAV_CMD_DO_LAST = 240,
1549 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1550 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1551 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1552 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1553 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1554 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1555 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1556 MAV_CMD_PREFLIGHT_STORAGE = 245,
1557 #[doc = "Request the reboot or shutdown of system components."]
1558 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1559 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1560 MAV_CMD_OVERRIDE_GOTO = 252,
1561 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1562 MAV_CMD_OBLIQUE_SURVEY = 260,
1563 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1564 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1565 #[doc = "start running a mission"]
1566 MAV_CMD_MISSION_START = 300,
1567 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1568 MAV_CMD_ACTUATOR_TEST = 310,
1569 #[doc = "Actuator configuration command."]
1570 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1571 #[doc = "Arms / Disarms a component"]
1572 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1573 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1574 MAV_CMD_RUN_PREARM_CHECKS = 401,
1575 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1576 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1577 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1579 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1580 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1581 MAV_CMD_GET_HOME_POSITION = 410,
1582 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1583 MAV_CMD_INJECT_FAILURE = 420,
1584 #[doc = "Starts receiver pairing."]
1585 MAV_CMD_START_RX_PAIR = 500,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1587 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1588 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1589 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1590 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1591 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1592 MAV_CMD_REQUEST_MESSAGE = 512,
1593 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1594 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1595 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1596 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1597 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1598 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1599 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1600 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1601 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1602 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1603 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1604 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1605 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1606 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1607 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1608 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_STORAGE_FORMAT = 526,
1610 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1611 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1612 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1613 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1614 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1615 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1616 #[doc = "Reset all camera settings to Factory Default"]
1617 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1618 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1619 MAV_CMD_SET_CAMERA_MODE = 530,
1620 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1621 MAV_CMD_SET_CAMERA_ZOOM = 531,
1622 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_FOCUS = 532,
1624 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1625 MAV_CMD_SET_STORAGE_USAGE = 533,
1626 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1627 MAV_CMD_SET_CAMERA_SOURCE = 534,
1628 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1629 MAV_CMD_JUMP_TAG = 600,
1630 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1631 MAV_CMD_DO_JUMP_TAG = 601,
1632 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1633 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1634 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1636 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1637 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1638 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1640 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1641 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1642 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1643 #[doc = "Enable or disable on-board camera triggering system."]
1644 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1645 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1646 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1647 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1649 #[doc = "Stops ongoing tracking."]
1650 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1651 #[doc = "Starts video capture (recording)."]
1652 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1653 #[doc = "Stop the current video capture (recording)."]
1654 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1655 #[doc = "Start video streaming"]
1656 MAV_CMD_VIDEO_START_STREAMING = 2502,
1657 #[doc = "Stop the given video stream"]
1658 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1659 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1660 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1661 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1662 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1663 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1664 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1665 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1666 MAV_CMD_LOGGING_START = 2510,
1667 #[doc = "Request to stop streaming log data over MAVLink"]
1668 MAV_CMD_LOGGING_STOP = 2511,
1669 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1670 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1671 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1672 #[doc = "Create a panorama at the current position"]
1673 MAV_CMD_PANORAMA_CREATE = 2800,
1674 #[doc = "Request VTOL transition"]
1675 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1676 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1677 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1678 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1679 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1680 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1682 #[doc = "Delay mission state machine until gate has been reached."]
1683 MAV_CMD_CONDITION_GATE = 4501,
1684 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1685 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1686 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1687 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1688 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1690 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1691 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1692 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1694 #[doc = "Rally point. You can have multiple rally points defined."]
1695 MAV_CMD_NAV_RALLY_POINT = 5100,
1696 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1697 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1698 #[doc = "Change state of safety switch."]
1699 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1700 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1701 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1702 #[deprecated = " (Deprecated since 2021-06)"]
1703 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1704 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1705 #[deprecated = " (Deprecated since 2021-06)"]
1706 #[doc = "Control the payload deployment."]
1707 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1708 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1709 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1710 #[doc = "Command to operate winch."]
1711 MAV_CMD_DO_WINCH = 42600,
1712 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1713 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1714 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1715 MAV_CMD_WAYPOINT_USER_1 = 31000,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_2 = 31001,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_3 = 31002,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_4 = 31003,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_5 = 31004,
1724 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1725 MAV_CMD_SPATIAL_USER_1 = 31005,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_2 = 31006,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_3 = 31007,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_4 = 31008,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_5 = 31009,
1734 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1735 MAV_CMD_USER_1 = 31010,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_2 = 31011,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_3 = 31012,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_4 = 31013,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_5 = 31014,
1744 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1745 MAV_CMD_CAN_FORWARD = 32000,
1746}
1747impl MavCmd {
1748 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1749}
1750impl Default for MavCmd {
1751 fn default() -> Self {
1752 Self::DEFAULT
1753 }
1754}
1755#[cfg_attr(feature = "ts", derive(TS))]
1756#[cfg_attr(feature = "ts", ts(export))]
1757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1759#[cfg_attr(feature = "serde", serde(tag = "type"))]
1760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1761#[repr(u32)]
1762#[doc = "Possible actions an aircraft can take to avoid a collision."]
1763pub enum MavCollisionAction {
1764 #[doc = "Ignore any potential collisions"]
1765 MAV_COLLISION_ACTION_NONE = 0,
1766 #[doc = "Report potential collision"]
1767 MAV_COLLISION_ACTION_REPORT = 1,
1768 #[doc = "Ascend or Descend to avoid threat"]
1769 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1770 #[doc = "Move horizontally to avoid threat"]
1771 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1772 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1773 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1774 #[doc = "Aircraft to fly directly back to its launch point"]
1775 MAV_COLLISION_ACTION_RTL = 5,
1776 #[doc = "Aircraft to stop in place"]
1777 MAV_COLLISION_ACTION_HOVER = 6,
1778}
1779impl MavCollisionAction {
1780 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1781}
1782impl Default for MavCollisionAction {
1783 fn default() -> Self {
1784 Self::DEFAULT
1785 }
1786}
1787#[cfg_attr(feature = "ts", derive(TS))]
1788#[cfg_attr(feature = "ts", ts(export))]
1789#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1791#[cfg_attr(feature = "serde", serde(tag = "type"))]
1792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1793#[repr(u32)]
1794#[doc = "Source of information about this collision."]
1795pub enum MavCollisionSrc {
1796 #[doc = "ID field references ADSB_VEHICLE packets"]
1797 MAV_COLLISION_SRC_ADSB = 0,
1798 #[doc = "ID field references MAVLink SRC ID"]
1799 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1800}
1801impl MavCollisionSrc {
1802 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1803}
1804impl Default for MavCollisionSrc {
1805 fn default() -> Self {
1806 Self::DEFAULT
1807 }
1808}
1809#[cfg_attr(feature = "ts", derive(TS))]
1810#[cfg_attr(feature = "ts", ts(export))]
1811#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1813#[cfg_attr(feature = "serde", serde(tag = "type"))]
1814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1815#[repr(u32)]
1816#[doc = "Aircraft-rated danger from this threat."]
1817pub enum MavCollisionThreatLevel {
1818 #[doc = "Not a threat"]
1819 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1820 #[doc = "Craft is mildly concerned about this threat"]
1821 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1822 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1823 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1824}
1825impl MavCollisionThreatLevel {
1826 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1827}
1828impl Default for MavCollisionThreatLevel {
1829 fn default() -> Self {
1830 Self::DEFAULT
1831 }
1832}
1833#[cfg_attr(feature = "ts", derive(TS))]
1834#[cfg_attr(feature = "ts", ts(export))]
1835#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1837#[cfg_attr(feature = "serde", serde(tag = "type"))]
1838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1839#[repr(u32)]
1840#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1841pub enum MavComponent {
1842 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1843 MAV_COMP_ID_ALL = 0,
1844 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1845 MAV_COMP_ID_AUTOPILOT1 = 1,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER1 = 25,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER2 = 26,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER3 = 27,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER4 = 28,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER5 = 29,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER6 = 30,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER7 = 31,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER8 = 32,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER9 = 33,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER10 = 34,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER11 = 35,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER12 = 36,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER13 = 37,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER14 = 38,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER15 = 39,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER16 = 40,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER17 = 41,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER18 = 42,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER19 = 43,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER20 = 44,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER21 = 45,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER22 = 46,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER23 = 47,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER24 = 48,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER25 = 49,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER26 = 50,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER27 = 51,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER28 = 52,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER29 = 53,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER30 = 54,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER31 = 55,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER32 = 56,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER33 = 57,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER34 = 58,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER35 = 59,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER36 = 60,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER37 = 61,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER38 = 62,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER39 = 63,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER40 = 64,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER41 = 65,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER42 = 66,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER43 = 67,
1932 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1933 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1934 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1935 MAV_COMP_ID_USER45 = 69,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER46 = 70,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER47 = 71,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER48 = 72,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER49 = 73,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER50 = 74,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER51 = 75,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER52 = 76,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER53 = 77,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER54 = 78,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER55 = 79,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER56 = 80,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER57 = 81,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER58 = 82,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER59 = 83,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER60 = 84,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER61 = 85,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER62 = 86,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER63 = 87,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER64 = 88,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER65 = 89,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER66 = 90,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER67 = 91,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER68 = 92,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER69 = 93,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER70 = 94,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER71 = 95,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER72 = 96,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER73 = 97,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER74 = 98,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER75 = 99,
1996 #[doc = "Camera #1."]
1997 MAV_COMP_ID_CAMERA = 100,
1998 #[doc = "Camera #2."]
1999 MAV_COMP_ID_CAMERA2 = 101,
2000 #[doc = "Camera #3."]
2001 MAV_COMP_ID_CAMERA3 = 102,
2002 #[doc = "Camera #4."]
2003 MAV_COMP_ID_CAMERA4 = 103,
2004 #[doc = "Camera #5."]
2005 MAV_COMP_ID_CAMERA5 = 104,
2006 #[doc = "Camera #6."]
2007 MAV_COMP_ID_CAMERA6 = 105,
2008 #[doc = "Servo #1."]
2009 MAV_COMP_ID_SERVO1 = 140,
2010 #[doc = "Servo #2."]
2011 MAV_COMP_ID_SERVO2 = 141,
2012 #[doc = "Servo #3."]
2013 MAV_COMP_ID_SERVO3 = 142,
2014 #[doc = "Servo #4."]
2015 MAV_COMP_ID_SERVO4 = 143,
2016 #[doc = "Servo #5."]
2017 MAV_COMP_ID_SERVO5 = 144,
2018 #[doc = "Servo #6."]
2019 MAV_COMP_ID_SERVO6 = 145,
2020 #[doc = "Servo #7."]
2021 MAV_COMP_ID_SERVO7 = 146,
2022 #[doc = "Servo #8."]
2023 MAV_COMP_ID_SERVO8 = 147,
2024 #[doc = "Servo #9."]
2025 MAV_COMP_ID_SERVO9 = 148,
2026 #[doc = "Servo #10."]
2027 MAV_COMP_ID_SERVO10 = 149,
2028 #[doc = "Servo #11."]
2029 MAV_COMP_ID_SERVO11 = 150,
2030 #[doc = "Servo #12."]
2031 MAV_COMP_ID_SERVO12 = 151,
2032 #[doc = "Servo #13."]
2033 MAV_COMP_ID_SERVO13 = 152,
2034 #[doc = "Servo #14."]
2035 MAV_COMP_ID_SERVO14 = 153,
2036 #[doc = "Gimbal #1."]
2037 MAV_COMP_ID_GIMBAL = 154,
2038 #[doc = "Logging component."]
2039 MAV_COMP_ID_LOG = 155,
2040 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2041 MAV_COMP_ID_ADSB = 156,
2042 #[doc = "On Screen Display (OSD) devices for video links."]
2043 MAV_COMP_ID_OSD = 157,
2044 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2045 MAV_COMP_ID_PERIPHERAL = 158,
2046 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2047 #[doc = "Gimbal ID for QX1."]
2048 MAV_COMP_ID_QX1_GIMBAL = 159,
2049 #[doc = "FLARM collision alert component."]
2050 MAV_COMP_ID_FLARM = 160,
2051 #[doc = "Parachute component."]
2052 MAV_COMP_ID_PARACHUTE = 161,
2053 #[doc = "Winch component."]
2054 MAV_COMP_ID_WINCH = 169,
2055 #[doc = "Gimbal #2."]
2056 MAV_COMP_ID_GIMBAL2 = 171,
2057 #[doc = "Gimbal #3."]
2058 MAV_COMP_ID_GIMBAL3 = 172,
2059 #[doc = "Gimbal #4"]
2060 MAV_COMP_ID_GIMBAL4 = 173,
2061 #[doc = "Gimbal #5."]
2062 MAV_COMP_ID_GIMBAL5 = 174,
2063 #[doc = "Gimbal #6."]
2064 MAV_COMP_ID_GIMBAL6 = 175,
2065 #[doc = "Battery #1."]
2066 MAV_COMP_ID_BATTERY = 180,
2067 #[doc = "Battery #2."]
2068 MAV_COMP_ID_BATTERY2 = 181,
2069 #[doc = "CAN over MAVLink client."]
2070 MAV_COMP_ID_MAVCAN = 189,
2071 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2072 MAV_COMP_ID_MISSIONPLANNER = 190,
2073 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2074 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2081 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2082 MAV_COMP_ID_PATHPLANNER = 195,
2083 #[doc = "Component that plans a collision free path between two points."]
2084 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2085 #[doc = "Component that provides position estimates using VIO techniques."]
2086 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2087 #[doc = "Component that manages pairing of vehicle and GCS."]
2088 MAV_COMP_ID_PAIRING_MANAGER = 198,
2089 #[doc = "Inertial Measurement Unit (IMU) #1."]
2090 MAV_COMP_ID_IMU = 200,
2091 #[doc = "Inertial Measurement Unit (IMU) #2."]
2092 MAV_COMP_ID_IMU_2 = 201,
2093 #[doc = "Inertial Measurement Unit (IMU) #3."]
2094 MAV_COMP_ID_IMU_3 = 202,
2095 #[doc = "GPS #1."]
2096 MAV_COMP_ID_GPS = 220,
2097 #[doc = "GPS #2."]
2098 MAV_COMP_ID_GPS2 = 221,
2099 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2100 MAV_COMP_ID_ODID_TXRX_1 = 236,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_2 = 237,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_3 = 238,
2105 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2106 MAV_COMP_ID_UDP_BRIDGE = 240,
2107 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2108 MAV_COMP_ID_UART_BRIDGE = 241,
2109 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2110 MAV_COMP_ID_TUNNEL_NODE = 242,
2111 #[doc = "Illuminator"]
2112 MAV_COMP_ID_ILLUMINATOR = 243,
2113 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2114 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2115 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2116}
2117impl MavComponent {
2118 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2119}
2120impl Default for MavComponent {
2121 fn default() -> Self {
2122 Self::DEFAULT
2123 }
2124}
2125#[cfg_attr(feature = "ts", derive(TS))]
2126#[cfg_attr(feature = "ts", ts(export))]
2127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2129#[cfg_attr(feature = "serde", serde(tag = "type"))]
2130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2131#[repr(u32)]
2132#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2133#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2134pub enum MavDataStream {
2135 #[doc = "Enable all data streams"]
2136 MAV_DATA_STREAM_ALL = 0,
2137 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2138 MAV_DATA_STREAM_RAW_SENSORS = 1,
2139 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2140 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2141 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2142 MAV_DATA_STREAM_RC_CHANNELS = 3,
2143 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2144 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2145 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2146 MAV_DATA_STREAM_POSITION = 6,
2147 #[doc = "Dependent on the autopilot"]
2148 MAV_DATA_STREAM_EXTRA1 = 10,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA2 = 11,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA3 = 12,
2153}
2154impl MavDataStream {
2155 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2156}
2157impl Default for MavDataStream {
2158 fn default() -> Self {
2159 Self::DEFAULT
2160 }
2161}
2162#[cfg_attr(feature = "ts", derive(TS))]
2163#[cfg_attr(feature = "ts", ts(export))]
2164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2166#[cfg_attr(feature = "serde", serde(tag = "type"))]
2167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2168#[repr(u32)]
2169#[doc = "Enumeration of distance sensor types"]
2170pub enum MavDistanceSensor {
2171 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2172 MAV_DISTANCE_SENSOR_LASER = 0,
2173 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2174 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2175 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2176 MAV_DISTANCE_SENSOR_INFRARED = 2,
2177 #[doc = "Radar type, e.g. uLanding units"]
2178 MAV_DISTANCE_SENSOR_RADAR = 3,
2179 #[doc = "Broken or unknown type, e.g. analog units"]
2180 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2181}
2182impl MavDistanceSensor {
2183 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2184}
2185impl Default for MavDistanceSensor {
2186 fn default() -> Self {
2187 Self::DEFAULT
2188 }
2189}
2190#[cfg_attr(feature = "ts", derive(TS))]
2191#[cfg_attr(feature = "ts", ts(export))]
2192#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2194#[cfg_attr(feature = "serde", serde(tag = "type"))]
2195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2196#[repr(u32)]
2197#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2198pub enum MavDoRepositionFlags {
2199 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2200 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2201}
2202impl MavDoRepositionFlags {
2203 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2204}
2205impl Default for MavDoRepositionFlags {
2206 fn default() -> Self {
2207 Self::DEFAULT
2208 }
2209}
2210#[cfg_attr(feature = "ts", derive(TS))]
2211#[cfg_attr(feature = "ts", ts(export))]
2212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2214#[cfg_attr(feature = "serde", serde(tag = "type"))]
2215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2216#[repr(u32)]
2217#[doc = "Enumeration of estimator types"]
2218pub enum MavEstimatorType {
2219 #[doc = "Unknown type of the estimator."]
2220 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2221 #[doc = "This is a naive estimator without any real covariance feedback."]
2222 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2223 #[doc = "Computer vision based estimate. Might be up to scale."]
2224 MAV_ESTIMATOR_TYPE_VISION = 2,
2225 #[doc = "Visual-inertial estimate."]
2226 MAV_ESTIMATOR_TYPE_VIO = 3,
2227 #[doc = "Plain GPS estimate."]
2228 MAV_ESTIMATOR_TYPE_GPS = 4,
2229 #[doc = "Estimator integrating GPS and inertial sensing."]
2230 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2231 #[doc = "Estimate from external motion capturing system."]
2232 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2233 #[doc = "Estimator based on lidar sensor input."]
2234 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2235 #[doc = "Estimator on autopilot."]
2236 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2237}
2238impl MavEstimatorType {
2239 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2240}
2241impl Default for MavEstimatorType {
2242 fn default() -> Self {
2243 Self::DEFAULT
2244 }
2245}
2246#[cfg_attr(feature = "ts", derive(TS))]
2247#[cfg_attr(feature = "ts", ts(export))]
2248#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2250#[cfg_attr(feature = "serde", serde(tag = "type"))]
2251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2252#[repr(u32)]
2253#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2254pub enum MavEventCurrentSequenceFlags {
2255 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2256 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2257}
2258impl MavEventCurrentSequenceFlags {
2259 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2260}
2261impl Default for MavEventCurrentSequenceFlags {
2262 fn default() -> Self {
2263 Self::DEFAULT
2264 }
2265}
2266#[cfg_attr(feature = "ts", derive(TS))]
2267#[cfg_attr(feature = "ts", ts(export))]
2268#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2269#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2270#[cfg_attr(feature = "serde", serde(tag = "type"))]
2271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2272#[repr(u32)]
2273#[doc = "Reason for an event error response."]
2274pub enum MavEventErrorReason {
2275 #[doc = "The requested event is not available (anymore)."]
2276 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2277}
2278impl MavEventErrorReason {
2279 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2280}
2281impl Default for MavEventErrorReason {
2282 fn default() -> Self {
2283 Self::DEFAULT
2284 }
2285}
2286#[cfg_attr(feature = "ts", derive(TS))]
2287#[cfg_attr(feature = "ts", ts(export))]
2288#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2290#[cfg_attr(feature = "serde", serde(tag = "type"))]
2291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2292#[repr(u32)]
2293#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2294pub enum MavFrame {
2295 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2296 MAV_FRAME_GLOBAL = 0,
2297 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2298 MAV_FRAME_LOCAL_NED = 1,
2299 #[doc = "NOT a coordinate frame, indicates a mission command."]
2300 MAV_FRAME_MISSION = 2,
2301 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2302 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2303 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2304 MAV_FRAME_LOCAL_ENU = 4,
2305 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2306 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2307 MAV_FRAME_GLOBAL_INT = 5,
2308 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2309 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2310 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2311 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2312 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2313 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2314 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2315 MAV_FRAME_BODY_NED = 8,
2316 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2317 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2318 MAV_FRAME_BODY_OFFSET_NED = 9,
2319 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2320 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2321 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2322 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2323 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2324 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2325 MAV_FRAME_BODY_FRD = 12,
2326 #[deprecated = " (Deprecated since 2019-04)"]
2327 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2328 MAV_FRAME_RESERVED_13 = 13,
2329 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2330 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2331 MAV_FRAME_RESERVED_14 = 14,
2332 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2333 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2334 MAV_FRAME_RESERVED_15 = 15,
2335 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2336 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2337 MAV_FRAME_RESERVED_16 = 16,
2338 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2339 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2340 MAV_FRAME_RESERVED_17 = 17,
2341 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2342 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2343 MAV_FRAME_RESERVED_18 = 18,
2344 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2345 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2346 MAV_FRAME_RESERVED_19 = 19,
2347 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2348 MAV_FRAME_LOCAL_FRD = 20,
2349 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FLU = 21,
2351}
2352impl MavFrame {
2353 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2354}
2355impl Default for MavFrame {
2356 fn default() -> Self {
2357 Self::DEFAULT
2358 }
2359}
2360#[cfg_attr(feature = "ts", derive(TS))]
2361#[cfg_attr(feature = "ts", ts(export))]
2362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2364#[cfg_attr(feature = "serde", serde(tag = "type"))]
2365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2366#[repr(u32)]
2367#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2368pub enum MavFtpErr {
2369 #[doc = "None: No error"]
2370 MAV_FTP_ERR_NONE = 0,
2371 #[doc = "Fail: Unknown failure"]
2372 MAV_FTP_ERR_FAIL = 1,
2373 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2374 MAV_FTP_ERR_FAILERRNO = 2,
2375 #[doc = "InvalidDataSize: Payload size is invalid"]
2376 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2377 #[doc = "InvalidSession: Session is not currently open"]
2378 MAV_FTP_ERR_INVALIDSESSION = 4,
2379 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2380 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2381 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2382 MAV_FTP_ERR_EOF = 6,
2383 #[doc = "UnknownCommand: Unknown command / opcode"]
2384 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2385 #[doc = "FileExists: File/directory already exists"]
2386 MAV_FTP_ERR_FILEEXISTS = 8,
2387 #[doc = "FileProtected: File/directory is write protected"]
2388 MAV_FTP_ERR_FILEPROTECTED = 9,
2389 #[doc = "FileNotFound: File/directory not found"]
2390 MAV_FTP_ERR_FILENOTFOUND = 10,
2391}
2392impl MavFtpErr {
2393 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2394}
2395impl Default for MavFtpErr {
2396 fn default() -> Self {
2397 Self::DEFAULT
2398 }
2399}
2400#[cfg_attr(feature = "ts", derive(TS))]
2401#[cfg_attr(feature = "ts", ts(export))]
2402#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2404#[cfg_attr(feature = "serde", serde(tag = "type"))]
2405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2406#[repr(u32)]
2407#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2408pub enum MavFtpOpcode {
2409 #[doc = "None. Ignored, always ACKed"]
2410 MAV_FTP_OPCODE_NONE = 0,
2411 #[doc = "TerminateSession: Terminates open Read session"]
2412 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2413 #[doc = "ResetSessions: Terminates all open read sessions"]
2414 MAV_FTP_OPCODE_RESETSESSION = 2,
2415 #[doc = "ListDirectory. List files and directories in path from offset"]
2416 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2417 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2418 MAV_FTP_OPCODE_OPENFILERO = 4,
2419 #[doc = "ReadFile: Reads size bytes from offset in session"]
2420 MAV_FTP_OPCODE_READFILE = 5,
2421 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2422 MAV_FTP_OPCODE_CREATEFILE = 6,
2423 #[doc = "WriteFile: Writes size bytes to offset in session"]
2424 MAV_FTP_OPCODE_WRITEFILE = 7,
2425 #[doc = "RemoveFile: Remove file at path"]
2426 MAV_FTP_OPCODE_REMOVEFILE = 8,
2427 #[doc = "CreateDirectory: Creates directory at path"]
2428 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2429 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2430 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2431 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2432 MAV_FTP_OPCODE_OPENFILEWO = 11,
2433 #[doc = "TruncateFile: Truncate file at path to offset length"]
2434 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2435 #[doc = "Rename: Rename path1 to path2"]
2436 MAV_FTP_OPCODE_RENAME = 13,
2437 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2438 MAV_FTP_OPCODE_CALCFILECRC = 14,
2439 #[doc = "BurstReadFile: Burst download session file"]
2440 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2441 #[doc = "ACK: ACK response"]
2442 MAV_FTP_OPCODE_ACK = 128,
2443 #[doc = "NAK: NAK response"]
2444 MAV_FTP_OPCODE_NAK = 129,
2445}
2446impl MavFtpOpcode {
2447 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2448}
2449impl Default for MavFtpOpcode {
2450 fn default() -> Self {
2451 Self::DEFAULT
2452 }
2453}
2454#[cfg_attr(feature = "ts", derive(TS))]
2455#[cfg_attr(feature = "ts", ts(export))]
2456#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2458#[cfg_attr(feature = "serde", serde(tag = "type"))]
2459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2460#[repr(u32)]
2461#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2462pub enum MavFuelType {
2463 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2464 MAV_FUEL_TYPE_UNKNOWN = 0,
2465 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2466 MAV_FUEL_TYPE_LIQUID = 1,
2467 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2468 MAV_FUEL_TYPE_GAS = 2,
2469}
2470impl MavFuelType {
2471 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2472}
2473impl Default for MavFuelType {
2474 fn default() -> Self {
2475 Self::DEFAULT
2476 }
2477}
2478bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2479impl MavGeneratorStatusFlag {
2480 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2481}
2482impl Default for MavGeneratorStatusFlag {
2483 fn default() -> Self {
2484 Self::DEFAULT
2485 }
2486}
2487#[cfg_attr(feature = "ts", derive(TS))]
2488#[cfg_attr(feature = "ts", ts(export))]
2489#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2491#[cfg_attr(feature = "serde", serde(tag = "type"))]
2492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2493#[repr(u32)]
2494#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2495pub enum MavGoto {
2496 #[doc = "Hold at the current position."]
2497 MAV_GOTO_DO_HOLD = 0,
2498 #[doc = "Continue with the next item in mission execution."]
2499 MAV_GOTO_DO_CONTINUE = 1,
2500 #[doc = "Hold at the current position of the system"]
2501 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2502 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2503 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2504}
2505impl MavGoto {
2506 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2507}
2508impl Default for MavGoto {
2509 fn default() -> Self {
2510 Self::DEFAULT
2511 }
2512}
2513#[cfg_attr(feature = "ts", derive(TS))]
2514#[cfg_attr(feature = "ts", ts(export))]
2515#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2516#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2517#[cfg_attr(feature = "serde", serde(tag = "type"))]
2518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2519#[repr(u32)]
2520#[doc = "Enumeration of landed detector states"]
2521pub enum MavLandedState {
2522 #[doc = "MAV landed state is unknown"]
2523 MAV_LANDED_STATE_UNDEFINED = 0,
2524 #[doc = "MAV is landed (on ground)"]
2525 MAV_LANDED_STATE_ON_GROUND = 1,
2526 #[doc = "MAV is in air"]
2527 MAV_LANDED_STATE_IN_AIR = 2,
2528 #[doc = "MAV currently taking off"]
2529 MAV_LANDED_STATE_TAKEOFF = 3,
2530 #[doc = "MAV currently landing"]
2531 MAV_LANDED_STATE_LANDING = 4,
2532}
2533impl MavLandedState {
2534 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2535}
2536impl Default for MavLandedState {
2537 fn default() -> Self {
2538 Self::DEFAULT
2539 }
2540}
2541#[cfg_attr(feature = "ts", derive(TS))]
2542#[cfg_attr(feature = "ts", ts(export))]
2543#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2545#[cfg_attr(feature = "serde", serde(tag = "type"))]
2546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2547#[repr(u32)]
2548#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2549pub enum MavMissionResult {
2550 #[doc = "mission accepted OK"]
2551 MAV_MISSION_ACCEPTED = 0,
2552 #[doc = "Generic error / not accepting mission commands at all right now."]
2553 MAV_MISSION_ERROR = 1,
2554 #[doc = "Coordinate frame is not supported."]
2555 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2556 #[doc = "Command is not supported."]
2557 MAV_MISSION_UNSUPPORTED = 3,
2558 #[doc = "Mission items exceed storage space."]
2559 MAV_MISSION_NO_SPACE = 4,
2560 #[doc = "One of the parameters has an invalid value."]
2561 MAV_MISSION_INVALID = 5,
2562 #[doc = "param1 has an invalid value."]
2563 MAV_MISSION_INVALID_PARAM1 = 6,
2564 #[doc = "param2 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM2 = 7,
2566 #[doc = "param3 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM3 = 8,
2568 #[doc = "param4 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM4 = 9,
2570 #[doc = "x / param5 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM5_X = 10,
2572 #[doc = "y / param6 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM6_Y = 11,
2574 #[doc = "z / param7 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM7 = 12,
2576 #[doc = "Mission item received out of sequence"]
2577 MAV_MISSION_INVALID_SEQUENCE = 13,
2578 #[doc = "Not accepting any mission commands from this communication partner."]
2579 MAV_MISSION_DENIED = 14,
2580 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2581 MAV_MISSION_OPERATION_CANCELLED = 15,
2582}
2583impl MavMissionResult {
2584 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2585}
2586impl Default for MavMissionResult {
2587 fn default() -> Self {
2588 Self::DEFAULT
2589 }
2590}
2591#[cfg_attr(feature = "ts", derive(TS))]
2592#[cfg_attr(feature = "ts", ts(export))]
2593#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2595#[cfg_attr(feature = "serde", serde(tag = "type"))]
2596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2597#[repr(u32)]
2598#[doc = "Type of mission items being requested/sent in mission protocol."]
2599pub enum MavMissionType {
2600 #[doc = "Items are mission commands for main mission."]
2601 MAV_MISSION_TYPE_MISSION = 0,
2602 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2603 MAV_MISSION_TYPE_FENCE = 1,
2604 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2605 MAV_MISSION_TYPE_RALLY = 2,
2606 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2607 MAV_MISSION_TYPE_ALL = 255,
2608}
2609impl MavMissionType {
2610 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2611}
2612impl Default for MavMissionType {
2613 fn default() -> Self {
2614 Self::DEFAULT
2615 }
2616}
2617#[cfg_attr(feature = "ts", derive(TS))]
2618#[cfg_attr(feature = "ts", ts(export))]
2619#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2621#[cfg_attr(feature = "serde", serde(tag = "type"))]
2622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2623#[repr(u32)]
2624#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2625pub enum MavMode {
2626 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2627 MAV_MODE_PREFLIGHT = 0,
2628 #[doc = "System is allowed to be active, under assisted RC control."]
2629 MAV_MODE_STABILIZE_DISARMED = 80,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_ARMED = 208,
2632 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2633 MAV_MODE_MANUAL_DISARMED = 64,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_ARMED = 192,
2636 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2637 MAV_MODE_GUIDED_DISARMED = 88,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_ARMED = 216,
2640 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2641 MAV_MODE_AUTO_DISARMED = 92,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_ARMED = 220,
2644 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2645 MAV_MODE_TEST_DISARMED = 66,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_ARMED = 194,
2648}
2649impl MavMode {
2650 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2651}
2652impl Default for MavMode {
2653 fn default() -> Self {
2654 Self::DEFAULT
2655 }
2656}
2657bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2658impl MavModeFlag {
2659 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2660}
2661impl Default for MavModeFlag {
2662 fn default() -> Self {
2663 Self::DEFAULT
2664 }
2665}
2666#[cfg_attr(feature = "ts", derive(TS))]
2667#[cfg_attr(feature = "ts", ts(export))]
2668#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2670#[cfg_attr(feature = "serde", serde(tag = "type"))]
2671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2672#[repr(u32)]
2673#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2674pub enum MavModeFlagDecodePosition {
2675 #[doc = "First bit: 10000000"]
2676 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2677 #[doc = "Second bit: 01000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2679 #[doc = "Third bit: 00100000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2681 #[doc = "Fourth bit: 00010000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2683 #[doc = "Fifth bit: 00001000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2685 #[doc = "Sixth bit: 00000100"]
2686 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2687 #[doc = "Seventh bit: 00000010"]
2688 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2689 #[doc = "Eighth bit: 00000001"]
2690 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2691}
2692impl MavModeFlagDecodePosition {
2693 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2694}
2695impl Default for MavModeFlagDecodePosition {
2696 fn default() -> Self {
2697 Self::DEFAULT
2698 }
2699}
2700bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2701impl MavModeProperty {
2702 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2703}
2704impl Default for MavModeProperty {
2705 fn default() -> Self {
2706 Self::DEFAULT
2707 }
2708}
2709#[cfg_attr(feature = "ts", derive(TS))]
2710#[cfg_attr(feature = "ts", ts(export))]
2711#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2713#[cfg_attr(feature = "serde", serde(tag = "type"))]
2714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2715#[repr(u32)]
2716#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2717#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2718pub enum MavMountMode {
2719 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2720 MAV_MOUNT_MODE_RETRACT = 0,
2721 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2722 MAV_MOUNT_MODE_NEUTRAL = 1,
2723 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2724 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2725 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_RC_TARGETING = 3,
2727 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2728 MAV_MOUNT_MODE_GPS_POINT = 4,
2729 #[doc = "Gimbal tracks system with specified system ID"]
2730 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2731 #[doc = "Gimbal tracks home position"]
2732 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2733}
2734impl MavMountMode {
2735 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2736}
2737impl Default for MavMountMode {
2738 fn default() -> Self {
2739 Self::DEFAULT
2740 }
2741}
2742#[cfg_attr(feature = "ts", derive(TS))]
2743#[cfg_attr(feature = "ts", ts(export))]
2744#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2746#[cfg_attr(feature = "serde", serde(tag = "type"))]
2747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2748#[repr(u32)]
2749pub enum MavOdidArmStatus {
2750 #[doc = "Passing arming checks."]
2751 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2752 #[doc = "Generic arming failure, see error string for details."]
2753 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2754}
2755impl MavOdidArmStatus {
2756 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2757}
2758impl Default for MavOdidArmStatus {
2759 fn default() -> Self {
2760 Self::DEFAULT
2761 }
2762}
2763#[cfg_attr(feature = "ts", derive(TS))]
2764#[cfg_attr(feature = "ts", ts(export))]
2765#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2767#[cfg_attr(feature = "serde", serde(tag = "type"))]
2768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2769#[repr(u32)]
2770pub enum MavOdidAuthType {
2771 #[doc = "No authentication type is specified."]
2772 MAV_ODID_AUTH_TYPE_NONE = 0,
2773 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2774 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2775 #[doc = "Signature for the Operator ID."]
2776 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2777 #[doc = "Signature for the entire message set."]
2778 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2779 #[doc = "Authentication is provided by Network Remote ID."]
2780 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2781 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2782 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2783}
2784impl MavOdidAuthType {
2785 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2786}
2787impl Default for MavOdidAuthType {
2788 fn default() -> Self {
2789 Self::DEFAULT
2790 }
2791}
2792#[cfg_attr(feature = "ts", derive(TS))]
2793#[cfg_attr(feature = "ts", ts(export))]
2794#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2796#[cfg_attr(feature = "serde", serde(tag = "type"))]
2797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2798#[repr(u32)]
2799pub enum MavOdidCategoryEu {
2800 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2801 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2802 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2803 MAV_ODID_CATEGORY_EU_OPEN = 1,
2804 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2805 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2806 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2807 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2808}
2809impl MavOdidCategoryEu {
2810 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2811}
2812impl Default for MavOdidCategoryEu {
2813 fn default() -> Self {
2814 Self::DEFAULT
2815 }
2816}
2817#[cfg_attr(feature = "ts", derive(TS))]
2818#[cfg_attr(feature = "ts", ts(export))]
2819#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2821#[cfg_attr(feature = "serde", serde(tag = "type"))]
2822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2823#[repr(u32)]
2824pub enum MavOdidClassEu {
2825 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2826 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2827 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2828 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2830 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2832 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2834 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2836 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2838 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2840 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2841}
2842impl MavOdidClassEu {
2843 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2844}
2845impl Default for MavOdidClassEu {
2846 fn default() -> Self {
2847 Self::DEFAULT
2848 }
2849}
2850#[cfg_attr(feature = "ts", derive(TS))]
2851#[cfg_attr(feature = "ts", ts(export))]
2852#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2854#[cfg_attr(feature = "serde", serde(tag = "type"))]
2855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2856#[repr(u32)]
2857pub enum MavOdidClassificationType {
2858 #[doc = "The classification type for the UA is undeclared."]
2859 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2860 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2861 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2862}
2863impl MavOdidClassificationType {
2864 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2865}
2866impl Default for MavOdidClassificationType {
2867 fn default() -> Self {
2868 Self::DEFAULT
2869 }
2870}
2871#[cfg_attr(feature = "ts", derive(TS))]
2872#[cfg_attr(feature = "ts", ts(export))]
2873#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2875#[cfg_attr(feature = "serde", serde(tag = "type"))]
2876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2877#[repr(u32)]
2878pub enum MavOdidDescType {
2879 #[doc = "Optional free-form text description of the purpose of the flight."]
2880 MAV_ODID_DESC_TYPE_TEXT = 0,
2881 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2882 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2883 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2885}
2886impl MavOdidDescType {
2887 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2888}
2889impl Default for MavOdidDescType {
2890 fn default() -> Self {
2891 Self::DEFAULT
2892 }
2893}
2894#[cfg_attr(feature = "ts", derive(TS))]
2895#[cfg_attr(feature = "ts", ts(export))]
2896#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2897#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2898#[cfg_attr(feature = "serde", serde(tag = "type"))]
2899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2900#[repr(u32)]
2901pub enum MavOdidHeightRef {
2902 #[doc = "The height field is relative to the take-off location."]
2903 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2904 #[doc = "The height field is relative to ground."]
2905 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2906}
2907impl MavOdidHeightRef {
2908 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2909}
2910impl Default for MavOdidHeightRef {
2911 fn default() -> Self {
2912 Self::DEFAULT
2913 }
2914}
2915#[cfg_attr(feature = "ts", derive(TS))]
2916#[cfg_attr(feature = "ts", ts(export))]
2917#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2919#[cfg_attr(feature = "serde", serde(tag = "type"))]
2920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2921#[repr(u32)]
2922pub enum MavOdidHorAcc {
2923 #[doc = "The horizontal accuracy is unknown."]
2924 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2925 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2926 MAV_ODID_HOR_ACC_10NM = 1,
2927 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2928 MAV_ODID_HOR_ACC_4NM = 2,
2929 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2930 MAV_ODID_HOR_ACC_2NM = 3,
2931 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2932 MAV_ODID_HOR_ACC_1NM = 4,
2933 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2934 MAV_ODID_HOR_ACC_0_5NM = 5,
2935 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2936 MAV_ODID_HOR_ACC_0_3NM = 6,
2937 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2938 MAV_ODID_HOR_ACC_0_1NM = 7,
2939 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2940 MAV_ODID_HOR_ACC_0_05NM = 8,
2941 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2942 MAV_ODID_HOR_ACC_30_METER = 9,
2943 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2944 MAV_ODID_HOR_ACC_10_METER = 10,
2945 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2946 MAV_ODID_HOR_ACC_3_METER = 11,
2947 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2948 MAV_ODID_HOR_ACC_1_METER = 12,
2949}
2950impl MavOdidHorAcc {
2951 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2952}
2953impl Default for MavOdidHorAcc {
2954 fn default() -> Self {
2955 Self::DEFAULT
2956 }
2957}
2958#[cfg_attr(feature = "ts", derive(TS))]
2959#[cfg_attr(feature = "ts", ts(export))]
2960#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2962#[cfg_attr(feature = "serde", serde(tag = "type"))]
2963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2964#[repr(u32)]
2965pub enum MavOdidIdType {
2966 #[doc = "No type defined."]
2967 MAV_ODID_ID_TYPE_NONE = 0,
2968 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2969 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2970 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2971 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2972 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2973 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2974 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2975 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2976}
2977impl MavOdidIdType {
2978 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2979}
2980impl Default for MavOdidIdType {
2981 fn default() -> Self {
2982 Self::DEFAULT
2983 }
2984}
2985#[cfg_attr(feature = "ts", derive(TS))]
2986#[cfg_attr(feature = "ts", ts(export))]
2987#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2989#[cfg_attr(feature = "serde", serde(tag = "type"))]
2990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2991#[repr(u32)]
2992pub enum MavOdidOperatorIdType {
2993 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2994 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2995}
2996impl MavOdidOperatorIdType {
2997 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2998}
2999impl Default for MavOdidOperatorIdType {
3000 fn default() -> Self {
3001 Self::DEFAULT
3002 }
3003}
3004#[cfg_attr(feature = "ts", derive(TS))]
3005#[cfg_attr(feature = "ts", ts(export))]
3006#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3008#[cfg_attr(feature = "serde", serde(tag = "type"))]
3009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3010#[repr(u32)]
3011pub enum MavOdidOperatorLocationType {
3012 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3013 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3014 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3016 #[doc = "The location/altitude of the operator are fixed values."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3018}
3019impl MavOdidOperatorLocationType {
3020 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3021}
3022impl Default for MavOdidOperatorLocationType {
3023 fn default() -> Self {
3024 Self::DEFAULT
3025 }
3026}
3027#[cfg_attr(feature = "ts", derive(TS))]
3028#[cfg_attr(feature = "ts", ts(export))]
3029#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3031#[cfg_attr(feature = "serde", serde(tag = "type"))]
3032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3033#[repr(u32)]
3034pub enum MavOdidSpeedAcc {
3035 #[doc = "The speed accuracy is unknown."]
3036 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3037 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3038 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3039 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3040 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3041 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3042 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3043 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3044 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3045}
3046impl MavOdidSpeedAcc {
3047 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3048}
3049impl Default for MavOdidSpeedAcc {
3050 fn default() -> Self {
3051 Self::DEFAULT
3052 }
3053}
3054#[cfg_attr(feature = "ts", derive(TS))]
3055#[cfg_attr(feature = "ts", ts(export))]
3056#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3058#[cfg_attr(feature = "serde", serde(tag = "type"))]
3059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3060#[repr(u32)]
3061pub enum MavOdidStatus {
3062 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3063 MAV_ODID_STATUS_UNDECLARED = 0,
3064 #[doc = "The UA is on the ground."]
3065 MAV_ODID_STATUS_GROUND = 1,
3066 #[doc = "The UA is in the air."]
3067 MAV_ODID_STATUS_AIRBORNE = 2,
3068 #[doc = "The UA is having an emergency."]
3069 MAV_ODID_STATUS_EMERGENCY = 3,
3070 #[doc = "The remote ID system is failing or unreliable in some way."]
3071 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3072}
3073impl MavOdidStatus {
3074 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3075}
3076impl Default for MavOdidStatus {
3077 fn default() -> Self {
3078 Self::DEFAULT
3079 }
3080}
3081#[cfg_attr(feature = "ts", derive(TS))]
3082#[cfg_attr(feature = "ts", ts(export))]
3083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3085#[cfg_attr(feature = "serde", serde(tag = "type"))]
3086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3087#[repr(u32)]
3088pub enum MavOdidTimeAcc {
3089 #[doc = "The timestamp accuracy is unknown."]
3090 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3091 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3092 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3094 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3096 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3098 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3100 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3102 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3104 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3106 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3108 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3110 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3112 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3114 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3116 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3118 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3120 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3121}
3122impl MavOdidTimeAcc {
3123 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3124}
3125impl Default for MavOdidTimeAcc {
3126 fn default() -> Self {
3127 Self::DEFAULT
3128 }
3129}
3130#[cfg_attr(feature = "ts", derive(TS))]
3131#[cfg_attr(feature = "ts", ts(export))]
3132#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3134#[cfg_attr(feature = "serde", serde(tag = "type"))]
3135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3136#[repr(u32)]
3137pub enum MavOdidUaType {
3138 #[doc = "No UA (Unmanned Aircraft) type defined."]
3139 MAV_ODID_UA_TYPE_NONE = 0,
3140 #[doc = "Aeroplane/Airplane. Fixed wing."]
3141 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3142 #[doc = "Helicopter or multirotor."]
3143 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3144 #[doc = "Gyroplane."]
3145 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3146 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3147 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3148 #[doc = "Ornithopter."]
3149 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3150 #[doc = "Glider."]
3151 MAV_ODID_UA_TYPE_GLIDER = 6,
3152 #[doc = "Kite."]
3153 MAV_ODID_UA_TYPE_KITE = 7,
3154 #[doc = "Free Balloon."]
3155 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3156 #[doc = "Captive Balloon."]
3157 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3158 #[doc = "Airship. E.g. a blimp."]
3159 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3160 #[doc = "Free Fall/Parachute (unpowered)."]
3161 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3162 #[doc = "Rocket."]
3163 MAV_ODID_UA_TYPE_ROCKET = 12,
3164 #[doc = "Tethered powered aircraft."]
3165 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3166 #[doc = "Ground Obstacle."]
3167 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3168 #[doc = "Other type of aircraft not listed earlier."]
3169 MAV_ODID_UA_TYPE_OTHER = 15,
3170}
3171impl MavOdidUaType {
3172 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3173}
3174impl Default for MavOdidUaType {
3175 fn default() -> Self {
3176 Self::DEFAULT
3177 }
3178}
3179#[cfg_attr(feature = "ts", derive(TS))]
3180#[cfg_attr(feature = "ts", ts(export))]
3181#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3183#[cfg_attr(feature = "serde", serde(tag = "type"))]
3184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3185#[repr(u32)]
3186pub enum MavOdidVerAcc {
3187 #[doc = "The vertical accuracy is unknown."]
3188 MAV_ODID_VER_ACC_UNKNOWN = 0,
3189 #[doc = "The vertical accuracy is smaller than 150 meter."]
3190 MAV_ODID_VER_ACC_150_METER = 1,
3191 #[doc = "The vertical accuracy is smaller than 45 meter."]
3192 MAV_ODID_VER_ACC_45_METER = 2,
3193 #[doc = "The vertical accuracy is smaller than 25 meter."]
3194 MAV_ODID_VER_ACC_25_METER = 3,
3195 #[doc = "The vertical accuracy is smaller than 10 meter."]
3196 MAV_ODID_VER_ACC_10_METER = 4,
3197 #[doc = "The vertical accuracy is smaller than 3 meter."]
3198 MAV_ODID_VER_ACC_3_METER = 5,
3199 #[doc = "The vertical accuracy is smaller than 1 meter."]
3200 MAV_ODID_VER_ACC_1_METER = 6,
3201}
3202impl MavOdidVerAcc {
3203 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3204}
3205impl Default for MavOdidVerAcc {
3206 fn default() -> Self {
3207 Self::DEFAULT
3208 }
3209}
3210#[cfg_attr(feature = "ts", derive(TS))]
3211#[cfg_attr(feature = "ts", ts(export))]
3212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3214#[cfg_attr(feature = "serde", serde(tag = "type"))]
3215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3216#[repr(u32)]
3217#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3218pub enum MavParamExtType {
3219 #[doc = "8-bit unsigned integer"]
3220 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3221 #[doc = "8-bit signed integer"]
3222 MAV_PARAM_EXT_TYPE_INT8 = 2,
3223 #[doc = "16-bit unsigned integer"]
3224 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3225 #[doc = "16-bit signed integer"]
3226 MAV_PARAM_EXT_TYPE_INT16 = 4,
3227 #[doc = "32-bit unsigned integer"]
3228 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3229 #[doc = "32-bit signed integer"]
3230 MAV_PARAM_EXT_TYPE_INT32 = 6,
3231 #[doc = "64-bit unsigned integer"]
3232 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3233 #[doc = "64-bit signed integer"]
3234 MAV_PARAM_EXT_TYPE_INT64 = 8,
3235 #[doc = "32-bit floating-point"]
3236 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3237 #[doc = "64-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3239 #[doc = "Custom Type"]
3240 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3241}
3242impl MavParamExtType {
3243 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3244}
3245impl Default for MavParamExtType {
3246 fn default() -> Self {
3247 Self::DEFAULT
3248 }
3249}
3250#[cfg_attr(feature = "ts", derive(TS))]
3251#[cfg_attr(feature = "ts", ts(export))]
3252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3254#[cfg_attr(feature = "serde", serde(tag = "type"))]
3255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3256#[repr(u32)]
3257#[doc = "Specifies the datatype of a MAVLink parameter."]
3258pub enum MavParamType {
3259 #[doc = "8-bit unsigned integer"]
3260 MAV_PARAM_TYPE_UINT8 = 1,
3261 #[doc = "8-bit signed integer"]
3262 MAV_PARAM_TYPE_INT8 = 2,
3263 #[doc = "16-bit unsigned integer"]
3264 MAV_PARAM_TYPE_UINT16 = 3,
3265 #[doc = "16-bit signed integer"]
3266 MAV_PARAM_TYPE_INT16 = 4,
3267 #[doc = "32-bit unsigned integer"]
3268 MAV_PARAM_TYPE_UINT32 = 5,
3269 #[doc = "32-bit signed integer"]
3270 MAV_PARAM_TYPE_INT32 = 6,
3271 #[doc = "64-bit unsigned integer"]
3272 MAV_PARAM_TYPE_UINT64 = 7,
3273 #[doc = "64-bit signed integer"]
3274 MAV_PARAM_TYPE_INT64 = 8,
3275 #[doc = "32-bit floating-point"]
3276 MAV_PARAM_TYPE_REAL32 = 9,
3277 #[doc = "64-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL64 = 10,
3279}
3280impl MavParamType {
3281 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3282}
3283impl Default for MavParamType {
3284 fn default() -> Self {
3285 Self::DEFAULT
3286 }
3287}
3288bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3289impl MavPowerStatus {
3290 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3291}
3292impl Default for MavPowerStatus {
3293 fn default() -> Self {
3294 Self::DEFAULT
3295 }
3296}
3297bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3298impl MavProtocolCapability {
3299 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3300}
3301impl Default for MavProtocolCapability {
3302 fn default() -> Self {
3303 Self::DEFAULT
3304 }
3305}
3306#[cfg_attr(feature = "ts", derive(TS))]
3307#[cfg_attr(feature = "ts", ts(export))]
3308#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3310#[cfg_attr(feature = "serde", serde(tag = "type"))]
3311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3312#[repr(u32)]
3313#[doc = "Result from a MAVLink command (MAV_CMD)"]
3314pub enum MavResult {
3315 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3316 MAV_RESULT_ACCEPTED = 0,
3317 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3318 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3319 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3320 MAV_RESULT_DENIED = 2,
3321 #[doc = "Command is not supported (unknown)."]
3322 MAV_RESULT_UNSUPPORTED = 3,
3323 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3324 MAV_RESULT_FAILED = 4,
3325 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3326 MAV_RESULT_IN_PROGRESS = 5,
3327 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3328 MAV_RESULT_CANCELLED = 6,
3329 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3330 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3331 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3332 MAV_RESULT_COMMAND_INT_ONLY = 8,
3333 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3334 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3335}
3336impl MavResult {
3337 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3338}
3339impl Default for MavResult {
3340 fn default() -> Self {
3341 Self::DEFAULT
3342 }
3343}
3344#[cfg_attr(feature = "ts", derive(TS))]
3345#[cfg_attr(feature = "ts", ts(export))]
3346#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3348#[cfg_attr(feature = "serde", serde(tag = "type"))]
3349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3350#[repr(u32)]
3351#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3352#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3353pub enum MavRoi {
3354 #[doc = "No region of interest."]
3355 MAV_ROI_NONE = 0,
3356 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3357 MAV_ROI_WPNEXT = 1,
3358 #[doc = "Point toward given waypoint."]
3359 MAV_ROI_WPINDEX = 2,
3360 #[doc = "Point toward fixed location."]
3361 MAV_ROI_LOCATION = 3,
3362 #[doc = "Point toward of given id."]
3363 MAV_ROI_TARGET = 4,
3364}
3365impl MavRoi {
3366 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3367}
3368impl Default for MavRoi {
3369 fn default() -> Self {
3370 Self::DEFAULT
3371 }
3372}
3373#[cfg_attr(feature = "ts", derive(TS))]
3374#[cfg_attr(feature = "ts", ts(export))]
3375#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3377#[cfg_attr(feature = "serde", serde(tag = "type"))]
3378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3379#[repr(u32)]
3380#[doc = "Enumeration of sensor orientation, according to its rotations"]
3381pub enum MavSensorOrientation {
3382 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3383 MAV_SENSOR_ROTATION_NONE = 0,
3384 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3385 MAV_SENSOR_ROTATION_YAW_45 = 1,
3386 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3387 MAV_SENSOR_ROTATION_YAW_90 = 2,
3388 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3389 MAV_SENSOR_ROTATION_YAW_135 = 3,
3390 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3391 MAV_SENSOR_ROTATION_YAW_180 = 4,
3392 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3393 MAV_SENSOR_ROTATION_YAW_225 = 5,
3394 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3395 MAV_SENSOR_ROTATION_YAW_270 = 6,
3396 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3397 MAV_SENSOR_ROTATION_YAW_315 = 7,
3398 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3399 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3400 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3401 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3402 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3403 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3404 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3405 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3406 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3407 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3408 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3409 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3410 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3411 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3412 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3413 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3414 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3415 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3416 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3417 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3418 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3419 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3420 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3421 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3422 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3423 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3424 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3425 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3426 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3427 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3428 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3429 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3430 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3431 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3432 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3434 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3435 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3436 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3437 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3438 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3439 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3440 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3442 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3443 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3444 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3445 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3446 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3447 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3448 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3450 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3451 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3452 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3453 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3454 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3455 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3456 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3457 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3458 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3459 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3460 #[doc = "Pitch: 315"]
3461 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3462 #[doc = "Roll: 90, Pitch: 315"]
3463 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3464 #[doc = "Custom orientation"]
3465 MAV_SENSOR_ROTATION_CUSTOM = 100,
3466}
3467impl MavSensorOrientation {
3468 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3469}
3470impl Default for MavSensorOrientation {
3471 fn default() -> Self {
3472 Self::DEFAULT
3473 }
3474}
3475#[cfg_attr(feature = "ts", derive(TS))]
3476#[cfg_attr(feature = "ts", ts(export))]
3477#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3479#[cfg_attr(feature = "serde", serde(tag = "type"))]
3480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3481#[repr(u32)]
3482#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3483pub enum MavSeverity {
3484 #[doc = "System is unusable. This is a \"panic\" condition."]
3485 MAV_SEVERITY_EMERGENCY = 0,
3486 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3487 MAV_SEVERITY_ALERT = 1,
3488 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3489 MAV_SEVERITY_CRITICAL = 2,
3490 #[doc = "Indicates an error in secondary/redundant systems."]
3491 MAV_SEVERITY_ERROR = 3,
3492 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3493 MAV_SEVERITY_WARNING = 4,
3494 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3495 MAV_SEVERITY_NOTICE = 5,
3496 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3497 MAV_SEVERITY_INFO = 6,
3498 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3499 MAV_SEVERITY_DEBUG = 7,
3500}
3501impl MavSeverity {
3502 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3503}
3504impl Default for MavSeverity {
3505 fn default() -> Self {
3506 Self::DEFAULT
3507 }
3508}
3509#[cfg_attr(feature = "ts", derive(TS))]
3510#[cfg_attr(feature = "ts", ts(export))]
3511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3513#[cfg_attr(feature = "serde", serde(tag = "type"))]
3514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3515#[repr(u32)]
3516#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3517pub enum MavStandardMode {
3518 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3519 MAV_STANDARD_MODE_NON_STANDARD = 0,
3520 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3521 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3522 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3523 MAV_STANDARD_MODE_ORBIT = 2,
3524 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3525 MAV_STANDARD_MODE_CRUISE = 3,
3526 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3527 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3528 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3529 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3530 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3531 MAV_STANDARD_MODE_MISSION = 6,
3532 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3533 MAV_STANDARD_MODE_LAND = 7,
3534 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3535 MAV_STANDARD_MODE_TAKEOFF = 8,
3536}
3537impl MavStandardMode {
3538 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3539}
3540impl Default for MavStandardMode {
3541 fn default() -> Self {
3542 Self::DEFAULT
3543 }
3544}
3545#[cfg_attr(feature = "ts", derive(TS))]
3546#[cfg_attr(feature = "ts", ts(export))]
3547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3549#[cfg_attr(feature = "serde", serde(tag = "type"))]
3550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3551#[repr(u32)]
3552pub enum MavState {
3553 #[doc = "Uninitialized system, state is unknown."]
3554 MAV_STATE_UNINIT = 0,
3555 #[doc = "System is booting up."]
3556 MAV_STATE_BOOT = 1,
3557 #[doc = "System is calibrating and not flight-ready."]
3558 MAV_STATE_CALIBRATING = 2,
3559 #[doc = "System is grounded and on standby. It can be launched any time."]
3560 MAV_STATE_STANDBY = 3,
3561 #[doc = "System is active and might be already airborne. Motors are engaged."]
3562 MAV_STATE_ACTIVE = 4,
3563 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3564 MAV_STATE_CRITICAL = 5,
3565 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3566 MAV_STATE_EMERGENCY = 6,
3567 #[doc = "System just initialized its power-down sequence, will shut down now."]
3568 MAV_STATE_POWEROFF = 7,
3569 #[doc = "System is terminating itself (failsafe or commanded)."]
3570 MAV_STATE_FLIGHT_TERMINATION = 8,
3571}
3572impl MavState {
3573 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3574}
3575impl Default for MavState {
3576 fn default() -> Self {
3577 Self::DEFAULT
3578 }
3579}
3580bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3581impl MavSysStatusSensor {
3582 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3583}
3584impl Default for MavSysStatusSensor {
3585 fn default() -> Self {
3586 Self::DEFAULT
3587 }
3588}
3589bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3590impl MavSysStatusSensorExtended {
3591 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3592}
3593impl Default for MavSysStatusSensorExtended {
3594 fn default() -> Self {
3595 Self::DEFAULT
3596 }
3597}
3598#[cfg_attr(feature = "ts", derive(TS))]
3599#[cfg_attr(feature = "ts", ts(export))]
3600#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3602#[cfg_attr(feature = "serde", serde(tag = "type"))]
3603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3604#[repr(u32)]
3605pub enum MavTunnelPayloadType {
3606 #[doc = "Encoding of payload unknown."]
3607 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3608 #[doc = "Registered for STorM32 gimbal controller."]
3609 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3610 #[doc = "Registered for STorM32 gimbal controller."]
3611 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3612 #[doc = "Registered for STorM32 gimbal controller."]
3613 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3614 #[doc = "Registered for STorM32 gimbal controller."]
3615 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3616 #[doc = "Registered for STorM32 gimbal controller."]
3617 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3618 #[doc = "Registered for STorM32 gimbal controller."]
3619 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3620 #[doc = "Registered for STorM32 gimbal controller."]
3621 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3622 #[doc = "Registered for STorM32 gimbal controller."]
3623 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3624 #[doc = "Registered for STorM32 gimbal controller."]
3625 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3626 #[doc = "Registered for STorM32 gimbal controller."]
3627 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3628 #[doc = "Registered for ModalAI remote OSD protocol."]
3629 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3630 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3631 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3632 #[doc = "Registered for ModalAI vendor use."]
3633 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3634}
3635impl MavTunnelPayloadType {
3636 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3637}
3638impl Default for MavTunnelPayloadType {
3639 fn default() -> Self {
3640 Self::DEFAULT
3641 }
3642}
3643#[cfg_attr(feature = "ts", derive(TS))]
3644#[cfg_attr(feature = "ts", ts(export))]
3645#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3647#[cfg_attr(feature = "serde", serde(tag = "type"))]
3648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3649#[repr(u32)]
3650#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3651pub enum MavType {
3652 #[doc = "Generic micro air vehicle"]
3653 MAV_TYPE_GENERIC = 0,
3654 #[doc = "Fixed wing aircraft."]
3655 MAV_TYPE_FIXED_WING = 1,
3656 #[doc = "Quadrotor"]
3657 MAV_TYPE_QUADROTOR = 2,
3658 #[doc = "Coaxial helicopter"]
3659 MAV_TYPE_COAXIAL = 3,
3660 #[doc = "Normal helicopter with tail rotor."]
3661 MAV_TYPE_HELICOPTER = 4,
3662 #[doc = "Ground installation"]
3663 MAV_TYPE_ANTENNA_TRACKER = 5,
3664 #[doc = "Operator control unit / ground control station"]
3665 MAV_TYPE_GCS = 6,
3666 #[doc = "Airship, controlled"]
3667 MAV_TYPE_AIRSHIP = 7,
3668 #[doc = "Free balloon, uncontrolled"]
3669 MAV_TYPE_FREE_BALLOON = 8,
3670 #[doc = "Rocket"]
3671 MAV_TYPE_ROCKET = 9,
3672 #[doc = "Ground rover"]
3673 MAV_TYPE_GROUND_ROVER = 10,
3674 #[doc = "Surface vessel, boat, ship"]
3675 MAV_TYPE_SURFACE_BOAT = 11,
3676 #[doc = "Submarine"]
3677 MAV_TYPE_SUBMARINE = 12,
3678 #[doc = "Hexarotor"]
3679 MAV_TYPE_HEXAROTOR = 13,
3680 #[doc = "Octorotor"]
3681 MAV_TYPE_OCTOROTOR = 14,
3682 #[doc = "Tricopter"]
3683 MAV_TYPE_TRICOPTER = 15,
3684 #[doc = "Flapping wing"]
3685 MAV_TYPE_FLAPPING_WING = 16,
3686 #[doc = "Kite"]
3687 MAV_TYPE_KITE = 17,
3688 #[doc = "Onboard companion controller"]
3689 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3690 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3691 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3692 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3693 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3694 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3695 MAV_TYPE_VTOL_TILTROTOR = 21,
3696 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3697 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3698 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3699 MAV_TYPE_VTOL_TAILSITTER = 23,
3700 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3701 MAV_TYPE_VTOL_TILTWING = 24,
3702 #[doc = "VTOL reserved 5"]
3703 MAV_TYPE_VTOL_RESERVED5 = 25,
3704 #[doc = "Gimbal"]
3705 MAV_TYPE_GIMBAL = 26,
3706 #[doc = "ADSB system"]
3707 MAV_TYPE_ADSB = 27,
3708 #[doc = "Steerable, nonrigid airfoil"]
3709 MAV_TYPE_PARAFOIL = 28,
3710 #[doc = "Dodecarotor"]
3711 MAV_TYPE_DODECAROTOR = 29,
3712 #[doc = "Camera"]
3713 MAV_TYPE_CAMERA = 30,
3714 #[doc = "Charging station"]
3715 MAV_TYPE_CHARGING_STATION = 31,
3716 #[doc = "FLARM collision avoidance system"]
3717 MAV_TYPE_FLARM = 32,
3718 #[doc = "Servo"]
3719 MAV_TYPE_SERVO = 33,
3720 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3721 MAV_TYPE_ODID = 34,
3722 #[doc = "Decarotor"]
3723 MAV_TYPE_DECAROTOR = 35,
3724 #[doc = "Battery"]
3725 MAV_TYPE_BATTERY = 36,
3726 #[doc = "Parachute"]
3727 MAV_TYPE_PARACHUTE = 37,
3728 #[doc = "Log"]
3729 MAV_TYPE_LOG = 38,
3730 #[doc = "OSD"]
3731 MAV_TYPE_OSD = 39,
3732 #[doc = "IMU"]
3733 MAV_TYPE_IMU = 40,
3734 #[doc = "GPS"]
3735 MAV_TYPE_GPS = 41,
3736 #[doc = "Winch"]
3737 MAV_TYPE_WINCH = 42,
3738 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3739 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3740 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3741 MAV_TYPE_ILLUMINATOR = 44,
3742 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3743 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3744}
3745impl MavType {
3746 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3747}
3748impl Default for MavType {
3749 fn default() -> Self {
3750 Self::DEFAULT
3751 }
3752}
3753#[cfg_attr(feature = "ts", derive(TS))]
3754#[cfg_attr(feature = "ts", ts(export))]
3755#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3757#[cfg_attr(feature = "serde", serde(tag = "type"))]
3758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3759#[repr(u32)]
3760#[doc = "Enumeration of VTOL states"]
3761pub enum MavVtolState {
3762 #[doc = "MAV is not configured as VTOL"]
3763 MAV_VTOL_STATE_UNDEFINED = 0,
3764 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3765 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3766 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3767 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3768 #[doc = "VTOL is in multicopter state"]
3769 MAV_VTOL_STATE_MC = 3,
3770 #[doc = "VTOL is in fixed-wing state"]
3771 MAV_VTOL_STATE_FW = 4,
3772}
3773impl MavVtolState {
3774 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3775}
3776impl Default for MavVtolState {
3777 fn default() -> Self {
3778 Self::DEFAULT
3779 }
3780}
3781bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3782impl MavWinchStatusFlag {
3783 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3784}
3785impl Default for MavWinchStatusFlag {
3786 fn default() -> Self {
3787 Self::DEFAULT
3788 }
3789}
3790#[cfg_attr(feature = "ts", derive(TS))]
3791#[cfg_attr(feature = "ts", ts(export))]
3792#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3794#[cfg_attr(feature = "serde", serde(tag = "type"))]
3795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3796#[repr(u32)]
3797pub enum MavlinkDataStreamType {
3798 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3799 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3800 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3801 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3802 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3803 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3804}
3805impl MavlinkDataStreamType {
3806 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3807}
3808impl Default for MavlinkDataStreamType {
3809 fn default() -> Self {
3810 Self::DEFAULT
3811 }
3812}
3813#[cfg_attr(feature = "ts", derive(TS))]
3814#[cfg_attr(feature = "ts", ts(export))]
3815#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3817#[cfg_attr(feature = "serde", serde(tag = "type"))]
3818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3819#[repr(u32)]
3820#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3821pub enum MissionState {
3822 #[doc = "The mission status reporting is not supported."]
3823 MISSION_STATE_UNKNOWN = 0,
3824 #[doc = "No mission on the vehicle."]
3825 MISSION_STATE_NO_MISSION = 1,
3826 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3827 MISSION_STATE_NOT_STARTED = 2,
3828 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3829 MISSION_STATE_ACTIVE = 3,
3830 #[doc = "Mission is paused when in auto mode."]
3831 MISSION_STATE_PAUSED = 4,
3832 #[doc = "Mission has executed all mission items."]
3833 MISSION_STATE_COMPLETE = 5,
3834}
3835impl MissionState {
3836 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3837}
3838impl Default for MissionState {
3839 fn default() -> Self {
3840 Self::DEFAULT
3841 }
3842}
3843#[cfg_attr(feature = "ts", derive(TS))]
3844#[cfg_attr(feature = "ts", ts(export))]
3845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3847#[cfg_attr(feature = "serde", serde(tag = "type"))]
3848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3849#[repr(u32)]
3850#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3851pub enum MotorTestOrder {
3852 #[doc = "Default autopilot motor test method."]
3853 MOTOR_TEST_ORDER_DEFAULT = 0,
3854 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3855 MOTOR_TEST_ORDER_SEQUENCE = 1,
3856 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3857 MOTOR_TEST_ORDER_BOARD = 2,
3858}
3859impl MotorTestOrder {
3860 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3861}
3862impl Default for MotorTestOrder {
3863 fn default() -> Self {
3864 Self::DEFAULT
3865 }
3866}
3867#[cfg_attr(feature = "ts", derive(TS))]
3868#[cfg_attr(feature = "ts", ts(export))]
3869#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3871#[cfg_attr(feature = "serde", serde(tag = "type"))]
3872#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3873#[repr(u32)]
3874#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3875pub enum MotorTestThrottleType {
3876 #[doc = "Throttle as a percentage (0 ~ 100)"]
3877 MOTOR_TEST_THROTTLE_PERCENT = 0,
3878 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3879 MOTOR_TEST_THROTTLE_PWM = 1,
3880 #[doc = "Throttle pass-through from pilot's transmitter."]
3881 MOTOR_TEST_THROTTLE_PILOT = 2,
3882 #[doc = "Per-motor compass calibration test."]
3883 MOTOR_TEST_COMPASS_CAL = 3,
3884}
3885impl MotorTestThrottleType {
3886 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3887}
3888impl Default for MotorTestThrottleType {
3889 fn default() -> Self {
3890 Self::DEFAULT
3891 }
3892}
3893#[cfg_attr(feature = "ts", derive(TS))]
3894#[cfg_attr(feature = "ts", ts(export))]
3895#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3897#[cfg_attr(feature = "serde", serde(tag = "type"))]
3898#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3899#[repr(u32)]
3900pub enum NavVtolLandOptions {
3901 #[doc = "Default autopilot landing behaviour."]
3902 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3903 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3904 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3905 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3906 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3907}
3908impl NavVtolLandOptions {
3909 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3910}
3911impl Default for NavVtolLandOptions {
3912 fn default() -> Self {
3913 Self::DEFAULT
3914 }
3915}
3916#[cfg_attr(feature = "ts", derive(TS))]
3917#[cfg_attr(feature = "ts", ts(export))]
3918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3920#[cfg_attr(feature = "serde", serde(tag = "type"))]
3921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3922#[repr(u32)]
3923#[doc = "Yaw behaviour during orbit flight."]
3924pub enum OrbitYawBehaviour {
3925 #[doc = "Vehicle front points to the center (default)."]
3926 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3927 #[doc = "Vehicle front holds heading when message received."]
3928 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3929 #[doc = "Yaw uncontrolled."]
3930 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3931 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3932 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3933 #[doc = "Yaw controlled by RC input."]
3934 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3935 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3936 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3937}
3938impl OrbitYawBehaviour {
3939 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3940}
3941impl Default for OrbitYawBehaviour {
3942 fn default() -> Self {
3943 Self::DEFAULT
3944 }
3945}
3946#[cfg_attr(feature = "ts", derive(TS))]
3947#[cfg_attr(feature = "ts", ts(export))]
3948#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3950#[cfg_attr(feature = "serde", serde(tag = "type"))]
3951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3952#[repr(u32)]
3953#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3954pub enum ParachuteAction {
3955 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3956 PARACHUTE_DISABLE = 0,
3957 #[doc = "Enable auto-release of parachute."]
3958 PARACHUTE_ENABLE = 1,
3959 #[doc = "Release parachute and kill motors."]
3960 PARACHUTE_RELEASE = 2,
3961}
3962impl ParachuteAction {
3963 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3964}
3965impl Default for ParachuteAction {
3966 fn default() -> Self {
3967 Self::DEFAULT
3968 }
3969}
3970#[cfg_attr(feature = "ts", derive(TS))]
3971#[cfg_attr(feature = "ts", ts(export))]
3972#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3973#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3974#[cfg_attr(feature = "serde", serde(tag = "type"))]
3975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3976#[repr(u32)]
3977#[doc = "Result from PARAM_EXT_SET message."]
3978pub enum ParamAck {
3979 #[doc = "Parameter value ACCEPTED and SET"]
3980 PARAM_ACK_ACCEPTED = 0,
3981 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3982 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3983 #[doc = "Parameter failed to set"]
3984 PARAM_ACK_FAILED = 2,
3985 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3986 PARAM_ACK_IN_PROGRESS = 3,
3987}
3988impl ParamAck {
3989 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3990}
3991impl Default for ParamAck {
3992 fn default() -> Self {
3993 Self::DEFAULT
3994 }
3995}
3996bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3997impl PositionTargetTypemask {
3998 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3999}
4000impl Default for PositionTargetTypemask {
4001 fn default() -> Self {
4002 Self::DEFAULT
4003 }
4004}
4005#[cfg_attr(feature = "ts", derive(TS))]
4006#[cfg_attr(feature = "ts", ts(export))]
4007#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4008#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4009#[cfg_attr(feature = "serde", serde(tag = "type"))]
4010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4011#[repr(u32)]
4012#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4013pub enum PrecisionLandMode {
4014 #[doc = "Normal (non-precision) landing."]
4015 PRECISION_LAND_MODE_DISABLED = 0,
4016 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4017 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4018 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4019 PRECISION_LAND_MODE_REQUIRED = 2,
4020}
4021impl PrecisionLandMode {
4022 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4023}
4024impl Default for PrecisionLandMode {
4025 fn default() -> Self {
4026 Self::DEFAULT
4027 }
4028}
4029#[cfg_attr(feature = "ts", derive(TS))]
4030#[cfg_attr(feature = "ts", ts(export))]
4031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4033#[cfg_attr(feature = "serde", serde(tag = "type"))]
4034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4035#[repr(u32)]
4036#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4037pub enum PreflightStorageMissionAction {
4038 #[doc = "Read current mission data from persistent storage"]
4039 MISSION_READ_PERSISTENT = 0,
4040 #[doc = "Write current mission data to persistent storage"]
4041 MISSION_WRITE_PERSISTENT = 1,
4042 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4043 MISSION_RESET_DEFAULT = 2,
4044}
4045impl PreflightStorageMissionAction {
4046 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4047}
4048impl Default for PreflightStorageMissionAction {
4049 fn default() -> Self {
4050 Self::DEFAULT
4051 }
4052}
4053#[cfg_attr(feature = "ts", derive(TS))]
4054#[cfg_attr(feature = "ts", ts(export))]
4055#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4056#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4057#[cfg_attr(feature = "serde", serde(tag = "type"))]
4058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4059#[repr(u32)]
4060#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4061pub enum PreflightStorageParameterAction {
4062 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4063 PARAM_READ_PERSISTENT = 0,
4064 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4065 PARAM_WRITE_PERSISTENT = 1,
4066 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4067 PARAM_RESET_CONFIG_DEFAULT = 2,
4068 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4069 PARAM_RESET_SENSOR_DEFAULT = 3,
4070 #[doc = "Reset all parameters, including operation counters, to default values"]
4071 PARAM_RESET_ALL_DEFAULT = 4,
4072}
4073impl PreflightStorageParameterAction {
4074 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4075}
4076impl Default for PreflightStorageParameterAction {
4077 fn default() -> Self {
4078 Self::DEFAULT
4079 }
4080}
4081#[cfg_attr(feature = "ts", derive(TS))]
4082#[cfg_attr(feature = "ts", ts(export))]
4083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4085#[cfg_attr(feature = "serde", serde(tag = "type"))]
4086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4087#[repr(u32)]
4088#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4089pub enum RcSubType {
4090 #[doc = "Spektrum DSM2"]
4091 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4092 #[doc = "Spektrum DSMX"]
4093 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4094 #[doc = "Spektrum DSMX8"]
4095 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4096}
4097impl RcSubType {
4098 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4099}
4100impl Default for RcSubType {
4101 fn default() -> Self {
4102 Self::DEFAULT
4103 }
4104}
4105#[cfg_attr(feature = "ts", derive(TS))]
4106#[cfg_attr(feature = "ts", ts(export))]
4107#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4109#[cfg_attr(feature = "serde", serde(tag = "type"))]
4110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4111#[repr(u32)]
4112#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4113pub enum RcType {
4114 #[doc = "Spektrum"]
4115 RC_TYPE_SPEKTRUM = 0,
4116 #[doc = "CRSF"]
4117 RC_TYPE_CRSF = 1,
4118}
4119impl RcType {
4120 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4121}
4122impl Default for RcType {
4123 fn default() -> Self {
4124 Self::DEFAULT
4125 }
4126}
4127#[cfg_attr(feature = "ts", derive(TS))]
4128#[cfg_attr(feature = "ts", ts(export))]
4129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4131#[cfg_attr(feature = "serde", serde(tag = "type"))]
4132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4133#[repr(u32)]
4134#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4135pub enum RebootShutdownConditions {
4136 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4137 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4138 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4139 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4140}
4141impl RebootShutdownConditions {
4142 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4143}
4144impl Default for RebootShutdownConditions {
4145 fn default() -> Self {
4146 Self::DEFAULT
4147 }
4148}
4149#[cfg_attr(feature = "ts", derive(TS))]
4150#[cfg_attr(feature = "ts", ts(export))]
4151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4153#[cfg_attr(feature = "serde", serde(tag = "type"))]
4154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4155#[repr(u32)]
4156#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4157pub enum RtkBaselineCoordinateSystem {
4158 #[doc = "Earth-centered, Earth-fixed"]
4159 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4160 #[doc = "RTK basestation centered, north, east, down"]
4161 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4162}
4163impl RtkBaselineCoordinateSystem {
4164 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4165}
4166impl Default for RtkBaselineCoordinateSystem {
4167 fn default() -> Self {
4168 Self::DEFAULT
4169 }
4170}
4171#[cfg_attr(feature = "ts", derive(TS))]
4172#[cfg_attr(feature = "ts", ts(export))]
4173#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4175#[cfg_attr(feature = "serde", serde(tag = "type"))]
4176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4177#[repr(u32)]
4178#[doc = "Possible safety switch states."]
4179pub enum SafetySwitchState {
4180 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4181 SAFETY_SWITCH_STATE_SAFE = 0,
4182 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4183 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4184}
4185impl SafetySwitchState {
4186 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4187}
4188impl Default for SafetySwitchState {
4189 fn default() -> Self {
4190 Self::DEFAULT
4191 }
4192}
4193#[cfg_attr(feature = "ts", derive(TS))]
4194#[cfg_attr(feature = "ts", ts(export))]
4195#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4197#[cfg_attr(feature = "serde", serde(tag = "type"))]
4198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4199#[repr(u32)]
4200#[doc = "SERIAL_CONTROL device types"]
4201pub enum SerialControlDev {
4202 #[doc = "First telemetry port"]
4203 SERIAL_CONTROL_DEV_TELEM1 = 0,
4204 #[doc = "Second telemetry port"]
4205 SERIAL_CONTROL_DEV_TELEM2 = 1,
4206 #[doc = "First GPS port"]
4207 SERIAL_CONTROL_DEV_GPS1 = 2,
4208 #[doc = "Second GPS port"]
4209 SERIAL_CONTROL_DEV_GPS2 = 3,
4210 #[doc = "system shell"]
4211 SERIAL_CONTROL_DEV_SHELL = 10,
4212 #[doc = "SERIAL0"]
4213 SERIAL_CONTROL_SERIAL0 = 100,
4214 #[doc = "SERIAL1"]
4215 SERIAL_CONTROL_SERIAL1 = 101,
4216 #[doc = "SERIAL2"]
4217 SERIAL_CONTROL_SERIAL2 = 102,
4218 #[doc = "SERIAL3"]
4219 SERIAL_CONTROL_SERIAL3 = 103,
4220 #[doc = "SERIAL4"]
4221 SERIAL_CONTROL_SERIAL4 = 104,
4222 #[doc = "SERIAL5"]
4223 SERIAL_CONTROL_SERIAL5 = 105,
4224 #[doc = "SERIAL6"]
4225 SERIAL_CONTROL_SERIAL6 = 106,
4226 #[doc = "SERIAL7"]
4227 SERIAL_CONTROL_SERIAL7 = 107,
4228 #[doc = "SERIAL8"]
4229 SERIAL_CONTROL_SERIAL8 = 108,
4230 #[doc = "SERIAL9"]
4231 SERIAL_CONTROL_SERIAL9 = 109,
4232}
4233impl SerialControlDev {
4234 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4235}
4236impl Default for SerialControlDev {
4237 fn default() -> Self {
4238 Self::DEFAULT
4239 }
4240}
4241bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4242impl SerialControlFlag {
4243 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4244}
4245impl Default for SerialControlFlag {
4246 fn default() -> Self {
4247 Self::DEFAULT
4248 }
4249}
4250#[cfg_attr(feature = "ts", derive(TS))]
4251#[cfg_attr(feature = "ts", ts(export))]
4252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4254#[cfg_attr(feature = "serde", serde(tag = "type"))]
4255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4256#[repr(u32)]
4257#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4258pub enum SetFocusType {
4259 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4260 FOCUS_TYPE_STEP = 0,
4261 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4262 FOCUS_TYPE_CONTINUOUS = 1,
4263 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4264 FOCUS_TYPE_RANGE = 2,
4265 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4266 FOCUS_TYPE_METERS = 3,
4267 #[doc = "Focus automatically."]
4268 FOCUS_TYPE_AUTO = 4,
4269 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4270 FOCUS_TYPE_AUTO_SINGLE = 5,
4271 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4272 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4273}
4274impl SetFocusType {
4275 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4276}
4277impl Default for SetFocusType {
4278 fn default() -> Self {
4279 Self::DEFAULT
4280 }
4281}
4282#[cfg_attr(feature = "ts", derive(TS))]
4283#[cfg_attr(feature = "ts", ts(export))]
4284#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4286#[cfg_attr(feature = "serde", serde(tag = "type"))]
4287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4288#[repr(u32)]
4289#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4290pub enum SpeedType {
4291 #[doc = "Airspeed"]
4292 SPEED_TYPE_AIRSPEED = 0,
4293 #[doc = "Groundspeed"]
4294 SPEED_TYPE_GROUNDSPEED = 1,
4295 #[doc = "Climb speed"]
4296 SPEED_TYPE_CLIMB_SPEED = 2,
4297 #[doc = "Descent speed"]
4298 SPEED_TYPE_DESCENT_SPEED = 3,
4299}
4300impl SpeedType {
4301 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4302}
4303impl Default for SpeedType {
4304 fn default() -> Self {
4305 Self::DEFAULT
4306 }
4307}
4308#[cfg_attr(feature = "ts", derive(TS))]
4309#[cfg_attr(feature = "ts", ts(export))]
4310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4312#[cfg_attr(feature = "serde", serde(tag = "type"))]
4313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4314#[repr(u32)]
4315#[doc = "Flags to indicate the status of camera storage."]
4316pub enum StorageStatus {
4317 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4318 STORAGE_STATUS_EMPTY = 0,
4319 #[doc = "Storage present but unformatted."]
4320 STORAGE_STATUS_UNFORMATTED = 1,
4321 #[doc = "Storage present and ready."]
4322 STORAGE_STATUS_READY = 2,
4323 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4324 STORAGE_STATUS_NOT_SUPPORTED = 3,
4325}
4326impl StorageStatus {
4327 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4328}
4329impl Default for StorageStatus {
4330 fn default() -> Self {
4331 Self::DEFAULT
4332 }
4333}
4334#[cfg_attr(feature = "ts", derive(TS))]
4335#[cfg_attr(feature = "ts", ts(export))]
4336#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4338#[cfg_attr(feature = "serde", serde(tag = "type"))]
4339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4340#[repr(u32)]
4341#[doc = "Flags to indicate the type of storage."]
4342pub enum StorageType {
4343 #[doc = "Storage type is not known."]
4344 STORAGE_TYPE_UNKNOWN = 0,
4345 #[doc = "Storage type is USB device."]
4346 STORAGE_TYPE_USB_STICK = 1,
4347 #[doc = "Storage type is SD card."]
4348 STORAGE_TYPE_SD = 2,
4349 #[doc = "Storage type is microSD card."]
4350 STORAGE_TYPE_MICROSD = 3,
4351 #[doc = "Storage type is CFast."]
4352 STORAGE_TYPE_CF = 4,
4353 #[doc = "Storage type is CFexpress."]
4354 STORAGE_TYPE_CFE = 5,
4355 #[doc = "Storage type is XQD."]
4356 STORAGE_TYPE_XQD = 6,
4357 #[doc = "Storage type is HD mass storage type."]
4358 STORAGE_TYPE_HD = 7,
4359 #[doc = "Storage type is other, not listed type."]
4360 STORAGE_TYPE_OTHER = 254,
4361}
4362impl StorageType {
4363 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4364}
4365impl Default for StorageType {
4366 fn default() -> Self {
4367 Self::DEFAULT
4368 }
4369}
4370bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4371impl StorageUsageFlag {
4372 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4373}
4374impl Default for StorageUsageFlag {
4375 fn default() -> Self {
4376 Self::DEFAULT
4377 }
4378}
4379#[cfg_attr(feature = "ts", derive(TS))]
4380#[cfg_attr(feature = "ts", ts(export))]
4381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4383#[cfg_attr(feature = "serde", serde(tag = "type"))]
4384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4385#[repr(u32)]
4386#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4387pub enum TuneFormat {
4388 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4389 TUNE_FORMAT_QBASIC1_1 = 1,
4390 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4391 TUNE_FORMAT_MML_MODERN = 2,
4392}
4393impl TuneFormat {
4394 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4395}
4396impl Default for TuneFormat {
4397 fn default() -> Self {
4398 Self::DEFAULT
4399 }
4400}
4401#[cfg_attr(feature = "ts", derive(TS))]
4402#[cfg_attr(feature = "ts", ts(export))]
4403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4405#[cfg_attr(feature = "serde", serde(tag = "type"))]
4406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4407#[repr(u32)]
4408#[doc = "Generalized UAVCAN node health"]
4409pub enum UavcanNodeHealth {
4410 #[doc = "The node is functioning properly."]
4411 UAVCAN_NODE_HEALTH_OK = 0,
4412 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4413 UAVCAN_NODE_HEALTH_WARNING = 1,
4414 #[doc = "The node has encountered a major failure."]
4415 UAVCAN_NODE_HEALTH_ERROR = 2,
4416 #[doc = "The node has suffered a fatal malfunction."]
4417 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4418}
4419impl UavcanNodeHealth {
4420 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4421}
4422impl Default for UavcanNodeHealth {
4423 fn default() -> Self {
4424 Self::DEFAULT
4425 }
4426}
4427#[cfg_attr(feature = "ts", derive(TS))]
4428#[cfg_attr(feature = "ts", ts(export))]
4429#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4431#[cfg_attr(feature = "serde", serde(tag = "type"))]
4432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4433#[repr(u32)]
4434#[doc = "Generalized UAVCAN node mode"]
4435pub enum UavcanNodeMode {
4436 #[doc = "The node is performing its primary functions."]
4437 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4438 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4439 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4440 #[doc = "The node is under maintenance."]
4441 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4442 #[doc = "The node is in the process of updating its software."]
4443 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4444 #[doc = "The node is no longer available online."]
4445 UAVCAN_NODE_MODE_OFFLINE = 7,
4446}
4447impl UavcanNodeMode {
4448 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4449}
4450impl Default for UavcanNodeMode {
4451 fn default() -> Self {
4452 Self::DEFAULT
4453 }
4454}
4455bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4456impl UtmDataAvailFlags {
4457 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4458}
4459impl Default for UtmDataAvailFlags {
4460 fn default() -> Self {
4461 Self::DEFAULT
4462 }
4463}
4464#[cfg_attr(feature = "ts", derive(TS))]
4465#[cfg_attr(feature = "ts", ts(export))]
4466#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4467#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4468#[cfg_attr(feature = "serde", serde(tag = "type"))]
4469#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4470#[repr(u32)]
4471#[doc = "Airborne status of UAS."]
4472pub enum UtmFlightState {
4473 #[doc = "The flight state can't be determined."]
4474 UTM_FLIGHT_STATE_UNKNOWN = 1,
4475 #[doc = "UAS on ground."]
4476 UTM_FLIGHT_STATE_GROUND = 2,
4477 #[doc = "UAS airborne."]
4478 UTM_FLIGHT_STATE_AIRBORNE = 3,
4479 #[doc = "UAS is in an emergency flight state."]
4480 UTM_FLIGHT_STATE_EMERGENCY = 16,
4481 #[doc = "UAS has no active controls."]
4482 UTM_FLIGHT_STATE_NOCTRL = 32,
4483}
4484impl UtmFlightState {
4485 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4486}
4487impl Default for UtmFlightState {
4488 fn default() -> Self {
4489 Self::DEFAULT
4490 }
4491}
4492#[cfg_attr(feature = "ts", derive(TS))]
4493#[cfg_attr(feature = "ts", ts(export))]
4494#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4496#[cfg_attr(feature = "serde", serde(tag = "type"))]
4497#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4498#[repr(u32)]
4499#[doc = "Video stream encodings"]
4500pub enum VideoStreamEncoding {
4501 #[doc = "Stream encoding is unknown"]
4502 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4503 #[doc = "Stream encoding is H.264"]
4504 VIDEO_STREAM_ENCODING_H264 = 1,
4505 #[doc = "Stream encoding is H.265"]
4506 VIDEO_STREAM_ENCODING_H265 = 2,
4507}
4508impl VideoStreamEncoding {
4509 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4510}
4511impl Default for VideoStreamEncoding {
4512 fn default() -> Self {
4513 Self::DEFAULT
4514 }
4515}
4516bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4517impl VideoStreamStatusFlags {
4518 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4519}
4520impl Default for VideoStreamStatusFlags {
4521 fn default() -> Self {
4522 Self::DEFAULT
4523 }
4524}
4525#[cfg_attr(feature = "ts", derive(TS))]
4526#[cfg_attr(feature = "ts", ts(export))]
4527#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4528#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4529#[cfg_attr(feature = "serde", serde(tag = "type"))]
4530#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4531#[repr(u32)]
4532#[doc = "Video stream types"]
4533pub enum VideoStreamType {
4534 #[doc = "Stream is RTSP"]
4535 VIDEO_STREAM_TYPE_RTSP = 0,
4536 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4537 VIDEO_STREAM_TYPE_RTPUDP = 1,
4538 #[doc = "Stream is MPEG on TCP"]
4539 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4540 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4541 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4542}
4543impl VideoStreamType {
4544 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4545}
4546impl Default for VideoStreamType {
4547 fn default() -> Self {
4548 Self::DEFAULT
4549 }
4550}
4551#[cfg_attr(feature = "ts", derive(TS))]
4552#[cfg_attr(feature = "ts", ts(export))]
4553#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4554#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4555#[cfg_attr(feature = "serde", serde(tag = "type"))]
4556#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4557#[repr(u32)]
4558#[doc = "Direction of VTOL transition"]
4559pub enum VtolTransitionHeading {
4560 #[doc = "Respect the heading configuration of the vehicle."]
4561 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4562 #[doc = "Use the heading pointing towards the next waypoint."]
4563 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4564 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4565 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4566 #[doc = "Use the specified heading in parameter 4."]
4567 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4568 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4569 VTOL_TRANSITION_HEADING_ANY = 4,
4570}
4571impl VtolTransitionHeading {
4572 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4573}
4574impl Default for VtolTransitionHeading {
4575 fn default() -> Self {
4576 Self::DEFAULT
4577 }
4578}
4579#[cfg_attr(feature = "ts", derive(TS))]
4580#[cfg_attr(feature = "ts", ts(export))]
4581#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4583#[cfg_attr(feature = "serde", serde(tag = "type"))]
4584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4585#[repr(u32)]
4586#[doc = "WiFi Mode."]
4587pub enum WifiConfigApMode {
4588 #[doc = "WiFi mode is undefined."]
4589 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4590 #[doc = "WiFi configured as an access point."]
4591 WIFI_CONFIG_AP_MODE_AP = 1,
4592 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4593 WIFI_CONFIG_AP_MODE_STATION = 2,
4594 #[doc = "WiFi disabled."]
4595 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4596}
4597impl WifiConfigApMode {
4598 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4599}
4600impl Default for WifiConfigApMode {
4601 fn default() -> Self {
4602 Self::DEFAULT
4603 }
4604}
4605#[cfg_attr(feature = "ts", derive(TS))]
4606#[cfg_attr(feature = "ts", ts(export))]
4607#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4609#[cfg_attr(feature = "serde", serde(tag = "type"))]
4610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4611#[repr(u32)]
4612#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4613pub enum WifiConfigApResponse {
4614 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4615 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4616 #[doc = "Changes accepted."]
4617 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4618 #[doc = "Changes rejected."]
4619 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4620 #[doc = "Invalid Mode."]
4621 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4622 #[doc = "Invalid SSID."]
4623 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4624 #[doc = "Invalid Password."]
4625 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4626}
4627impl WifiConfigApResponse {
4628 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4629}
4630impl Default for WifiConfigApResponse {
4631 fn default() -> Self {
4632 Self::DEFAULT
4633 }
4634}
4635#[cfg_attr(feature = "ts", derive(TS))]
4636#[cfg_attr(feature = "ts", ts(export))]
4637#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4639#[cfg_attr(feature = "serde", serde(tag = "type"))]
4640#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4641#[repr(u32)]
4642#[doc = "Winch actions."]
4643pub enum WinchActions {
4644 #[doc = "Allow motor to freewheel."]
4645 WINCH_RELAXED = 0,
4646 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4647 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4648 #[doc = "Wind or unwind line at specified rate."]
4649 WINCH_RATE_CONTROL = 2,
4650 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4651 WINCH_LOCK = 3,
4652 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4653 WINCH_DELIVER = 4,
4654 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4655 WINCH_HOLD = 5,
4656 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4657 WINCH_RETRACT = 6,
4658 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4659 WINCH_LOAD_LINE = 7,
4660 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4661 WINCH_ABANDON_LINE = 8,
4662 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4663 WINCH_LOAD_PAYLOAD = 9,
4664}
4665impl WinchActions {
4666 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4667}
4668impl Default for WinchActions {
4669 fn default() -> Self {
4670 Self::DEFAULT
4671 }
4672}
4673#[doc = "Set the vehicle attitude and body angular rates."]
4674#[doc = ""]
4675#[doc = "ID: 140"]
4676#[derive(Debug, Clone, PartialEq)]
4677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4679#[cfg_attr(feature = "ts", derive(TS))]
4680#[cfg_attr(feature = "ts", ts(export))]
4681pub struct ACTUATOR_CONTROL_TARGET_DATA {
4682 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4683 pub time_usec: u64,
4684 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4685 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4686 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4687 pub controls: [f32; 8],
4688 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4689 pub group_mlx: u8,
4690}
4691impl ACTUATOR_CONTROL_TARGET_DATA {
4692 pub const ENCODED_LEN: usize = 41usize;
4693 pub const DEFAULT: Self = Self {
4694 time_usec: 0_u64,
4695 controls: [0.0_f32; 8usize],
4696 group_mlx: 0_u8,
4697 };
4698 #[cfg(feature = "arbitrary")]
4699 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4700 use arbitrary::{Arbitrary, Unstructured};
4701 let mut buf = [0u8; 1024];
4702 rng.fill_bytes(&mut buf);
4703 let mut unstructured = Unstructured::new(&buf);
4704 Self::arbitrary(&mut unstructured).unwrap_or_default()
4705 }
4706}
4707impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4708 fn default() -> Self {
4709 Self::DEFAULT.clone()
4710 }
4711}
4712impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4713 type Message = MavMessage;
4714 const ID: u32 = 140u32;
4715 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4716 const EXTRA_CRC: u8 = 181u8;
4717 const ENCODED_LEN: usize = 41usize;
4718 fn deser(
4719 _version: MavlinkVersion,
4720 __input: &[u8],
4721 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4722 let avail_len = __input.len();
4723 let mut payload_buf = [0; Self::ENCODED_LEN];
4724 let mut buf = if avail_len < Self::ENCODED_LEN {
4725 payload_buf[0..avail_len].copy_from_slice(__input);
4726 Bytes::new(&payload_buf)
4727 } else {
4728 Bytes::new(__input)
4729 };
4730 let mut __struct = Self::default();
4731 __struct.time_usec = buf.get_u64_le();
4732 for v in &mut __struct.controls {
4733 let val = buf.get_f32_le();
4734 *v = val;
4735 }
4736 __struct.group_mlx = buf.get_u8();
4737 Ok(__struct)
4738 }
4739 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4740 let mut __tmp = BytesMut::new(bytes);
4741 #[allow(clippy::absurd_extreme_comparisons)]
4742 #[allow(unused_comparisons)]
4743 if __tmp.remaining() < Self::ENCODED_LEN {
4744 panic!(
4745 "buffer is too small (need {} bytes, but got {})",
4746 Self::ENCODED_LEN,
4747 __tmp.remaining(),
4748 )
4749 }
4750 __tmp.put_u64_le(self.time_usec);
4751 for val in &self.controls {
4752 __tmp.put_f32_le(*val);
4753 }
4754 __tmp.put_u8(self.group_mlx);
4755 if matches!(version, MavlinkVersion::V2) {
4756 let len = __tmp.len();
4757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4758 } else {
4759 __tmp.len()
4760 }
4761 }
4762}
4763#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4764#[doc = ""]
4765#[doc = "ID: 375"]
4766#[derive(Debug, Clone, PartialEq)]
4767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4769#[cfg_attr(feature = "ts", derive(TS))]
4770#[cfg_attr(feature = "ts", ts(export))]
4771pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4772 #[doc = "Timestamp (since system boot)."]
4773 pub time_usec: u64,
4774 #[doc = "Active outputs"]
4775 pub active: u32,
4776 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4777 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4778 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4779 pub actuator: [f32; 32],
4780}
4781impl ACTUATOR_OUTPUT_STATUS_DATA {
4782 pub const ENCODED_LEN: usize = 140usize;
4783 pub const DEFAULT: Self = Self {
4784 time_usec: 0_u64,
4785 active: 0_u32,
4786 actuator: [0.0_f32; 32usize],
4787 };
4788 #[cfg(feature = "arbitrary")]
4789 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4790 use arbitrary::{Arbitrary, Unstructured};
4791 let mut buf = [0u8; 1024];
4792 rng.fill_bytes(&mut buf);
4793 let mut unstructured = Unstructured::new(&buf);
4794 Self::arbitrary(&mut unstructured).unwrap_or_default()
4795 }
4796}
4797impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4798 fn default() -> Self {
4799 Self::DEFAULT.clone()
4800 }
4801}
4802impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4803 type Message = MavMessage;
4804 const ID: u32 = 375u32;
4805 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4806 const EXTRA_CRC: u8 = 251u8;
4807 const ENCODED_LEN: usize = 140usize;
4808 fn deser(
4809 _version: MavlinkVersion,
4810 __input: &[u8],
4811 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4812 let avail_len = __input.len();
4813 let mut payload_buf = [0; Self::ENCODED_LEN];
4814 let mut buf = if avail_len < Self::ENCODED_LEN {
4815 payload_buf[0..avail_len].copy_from_slice(__input);
4816 Bytes::new(&payload_buf)
4817 } else {
4818 Bytes::new(__input)
4819 };
4820 let mut __struct = Self::default();
4821 __struct.time_usec = buf.get_u64_le();
4822 __struct.active = buf.get_u32_le();
4823 for v in &mut __struct.actuator {
4824 let val = buf.get_f32_le();
4825 *v = val;
4826 }
4827 Ok(__struct)
4828 }
4829 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4830 let mut __tmp = BytesMut::new(bytes);
4831 #[allow(clippy::absurd_extreme_comparisons)]
4832 #[allow(unused_comparisons)]
4833 if __tmp.remaining() < Self::ENCODED_LEN {
4834 panic!(
4835 "buffer is too small (need {} bytes, but got {})",
4836 Self::ENCODED_LEN,
4837 __tmp.remaining(),
4838 )
4839 }
4840 __tmp.put_u64_le(self.time_usec);
4841 __tmp.put_u32_le(self.active);
4842 for val in &self.actuator {
4843 __tmp.put_f32_le(*val);
4844 }
4845 if matches!(version, MavlinkVersion::V2) {
4846 let len = __tmp.len();
4847 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4848 } else {
4849 __tmp.len()
4850 }
4851 }
4852}
4853#[doc = "The location and information of an ADSB vehicle."]
4854#[doc = ""]
4855#[doc = "ID: 246"]
4856#[derive(Debug, Clone, PartialEq)]
4857#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4859#[cfg_attr(feature = "ts", derive(TS))]
4860#[cfg_attr(feature = "ts", ts(export))]
4861pub struct ADSB_VEHICLE_DATA {
4862 #[doc = "ICAO address"]
4863 pub ICAO_address: u32,
4864 #[doc = "Latitude"]
4865 pub lat: i32,
4866 #[doc = "Longitude"]
4867 pub lon: i32,
4868 #[doc = "Altitude(ASL)"]
4869 pub altitude: i32,
4870 #[doc = "Course over ground"]
4871 pub heading: u16,
4872 #[doc = "The horizontal velocity"]
4873 pub hor_velocity: u16,
4874 #[doc = "The vertical velocity. Positive is up"]
4875 pub ver_velocity: i16,
4876 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4877 pub flags: AdsbFlags,
4878 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4879 pub squawk: u16,
4880 #[doc = "ADSB altitude type."]
4881 pub altitude_type: AdsbAltitudeType,
4882 #[doc = "The callsign, 8+null"]
4883 #[cfg_attr(
4884 feature = "serde",
4885 serde(
4886 serialize_with = "crate::nulstr::serialize::<_, 9>",
4887 deserialize_with = "crate::nulstr::deserialize::<_, 9>"
4888 )
4889 )]
4890 #[cfg_attr(feature = "ts", ts(type = "string"))]
4891 pub callsign: [u8; 9],
4892 #[doc = "ADSB emitter type."]
4893 pub emitter_type: AdsbEmitterType,
4894 #[doc = "Time since last communication in seconds"]
4895 pub tslc: u8,
4896}
4897impl ADSB_VEHICLE_DATA {
4898 pub const ENCODED_LEN: usize = 38usize;
4899 pub const DEFAULT: Self = Self {
4900 ICAO_address: 0_u32,
4901 lat: 0_i32,
4902 lon: 0_i32,
4903 altitude: 0_i32,
4904 heading: 0_u16,
4905 hor_velocity: 0_u16,
4906 ver_velocity: 0_i16,
4907 flags: AdsbFlags::DEFAULT,
4908 squawk: 0_u16,
4909 altitude_type: AdsbAltitudeType::DEFAULT,
4910 callsign: [0_u8; 9usize],
4911 emitter_type: AdsbEmitterType::DEFAULT,
4912 tslc: 0_u8,
4913 };
4914 #[cfg(feature = "arbitrary")]
4915 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4916 use arbitrary::{Arbitrary, Unstructured};
4917 let mut buf = [0u8; 1024];
4918 rng.fill_bytes(&mut buf);
4919 let mut unstructured = Unstructured::new(&buf);
4920 Self::arbitrary(&mut unstructured).unwrap_or_default()
4921 }
4922}
4923impl Default for ADSB_VEHICLE_DATA {
4924 fn default() -> Self {
4925 Self::DEFAULT.clone()
4926 }
4927}
4928impl MessageData for ADSB_VEHICLE_DATA {
4929 type Message = MavMessage;
4930 const ID: u32 = 246u32;
4931 const NAME: &'static str = "ADSB_VEHICLE";
4932 const EXTRA_CRC: u8 = 184u8;
4933 const ENCODED_LEN: usize = 38usize;
4934 fn deser(
4935 _version: MavlinkVersion,
4936 __input: &[u8],
4937 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4938 let avail_len = __input.len();
4939 let mut payload_buf = [0; Self::ENCODED_LEN];
4940 let mut buf = if avail_len < Self::ENCODED_LEN {
4941 payload_buf[0..avail_len].copy_from_slice(__input);
4942 Bytes::new(&payload_buf)
4943 } else {
4944 Bytes::new(__input)
4945 };
4946 let mut __struct = Self::default();
4947 __struct.ICAO_address = buf.get_u32_le();
4948 __struct.lat = buf.get_i32_le();
4949 __struct.lon = buf.get_i32_le();
4950 __struct.altitude = buf.get_i32_le();
4951 __struct.heading = buf.get_u16_le();
4952 __struct.hor_velocity = buf.get_u16_le();
4953 __struct.ver_velocity = buf.get_i16_le();
4954 let tmp = buf.get_u16_le();
4955 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4956 ::mavlink_core::error::ParserError::InvalidFlag {
4957 flag_type: "AdsbFlags",
4958 value: tmp as u32,
4959 },
4960 )?;
4961 __struct.squawk = buf.get_u16_le();
4962 let tmp = buf.get_u8();
4963 __struct.altitude_type =
4964 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4965 enum_type: "AdsbAltitudeType",
4966 value: tmp as u32,
4967 })?;
4968 for v in &mut __struct.callsign {
4969 let val = buf.get_u8();
4970 *v = val;
4971 }
4972 let tmp = buf.get_u8();
4973 __struct.emitter_type =
4974 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4975 enum_type: "AdsbEmitterType",
4976 value: tmp as u32,
4977 })?;
4978 __struct.tslc = buf.get_u8();
4979 Ok(__struct)
4980 }
4981 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4982 let mut __tmp = BytesMut::new(bytes);
4983 #[allow(clippy::absurd_extreme_comparisons)]
4984 #[allow(unused_comparisons)]
4985 if __tmp.remaining() < Self::ENCODED_LEN {
4986 panic!(
4987 "buffer is too small (need {} bytes, but got {})",
4988 Self::ENCODED_LEN,
4989 __tmp.remaining(),
4990 )
4991 }
4992 __tmp.put_u32_le(self.ICAO_address);
4993 __tmp.put_i32_le(self.lat);
4994 __tmp.put_i32_le(self.lon);
4995 __tmp.put_i32_le(self.altitude);
4996 __tmp.put_u16_le(self.heading);
4997 __tmp.put_u16_le(self.hor_velocity);
4998 __tmp.put_i16_le(self.ver_velocity);
4999 __tmp.put_u16_le(self.flags.bits());
5000 __tmp.put_u16_le(self.squawk);
5001 __tmp.put_u8(self.altitude_type as u8);
5002 for val in &self.callsign {
5003 __tmp.put_u8(*val);
5004 }
5005 __tmp.put_u8(self.emitter_type as u8);
5006 __tmp.put_u8(self.tslc);
5007 if matches!(version, MavlinkVersion::V2) {
5008 let len = __tmp.len();
5009 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5010 } else {
5011 __tmp.len()
5012 }
5013 }
5014}
5015#[doc = "The location and information of an AIS vessel."]
5016#[doc = ""]
5017#[doc = "ID: 301"]
5018#[derive(Debug, Clone, PartialEq)]
5019#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5020#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5021#[cfg_attr(feature = "ts", derive(TS))]
5022#[cfg_attr(feature = "ts", ts(export))]
5023pub struct AIS_VESSEL_DATA {
5024 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5025 pub MMSI: u32,
5026 #[doc = "Latitude"]
5027 pub lat: i32,
5028 #[doc = "Longitude"]
5029 pub lon: i32,
5030 #[doc = "Course over ground"]
5031 pub COG: u16,
5032 #[doc = "True heading"]
5033 pub heading: u16,
5034 #[doc = "Speed over ground"]
5035 pub velocity: u16,
5036 #[doc = "Distance from lat/lon location to bow"]
5037 pub dimension_bow: u16,
5038 #[doc = "Distance from lat/lon location to stern"]
5039 pub dimension_stern: u16,
5040 #[doc = "Time since last communication in seconds"]
5041 pub tslc: u16,
5042 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5043 pub flags: AisFlags,
5044 #[doc = "Turn rate"]
5045 pub turn_rate: i8,
5046 #[doc = "Navigational status"]
5047 pub navigational_status: AisNavStatus,
5048 #[doc = "Type of vessels"]
5049 pub mavtype: AisType,
5050 #[doc = "Distance from lat/lon location to port side"]
5051 pub dimension_port: u8,
5052 #[doc = "Distance from lat/lon location to starboard side"]
5053 pub dimension_starboard: u8,
5054 #[doc = "The vessel callsign"]
5055 #[cfg_attr(
5056 feature = "serde",
5057 serde(
5058 serialize_with = "crate::nulstr::serialize::<_, 7>",
5059 deserialize_with = "crate::nulstr::deserialize::<_, 7>"
5060 )
5061 )]
5062 #[cfg_attr(feature = "ts", ts(type = "string"))]
5063 pub callsign: [u8; 7],
5064 #[doc = "The vessel name"]
5065 #[cfg_attr(
5066 feature = "serde",
5067 serde(
5068 serialize_with = "crate::nulstr::serialize::<_, 20>",
5069 deserialize_with = "crate::nulstr::deserialize::<_, 20>"
5070 )
5071 )]
5072 #[cfg_attr(feature = "ts", ts(type = "string"))]
5073 pub name: [u8; 20],
5074}
5075impl AIS_VESSEL_DATA {
5076 pub const ENCODED_LEN: usize = 58usize;
5077 pub const DEFAULT: Self = Self {
5078 MMSI: 0_u32,
5079 lat: 0_i32,
5080 lon: 0_i32,
5081 COG: 0_u16,
5082 heading: 0_u16,
5083 velocity: 0_u16,
5084 dimension_bow: 0_u16,
5085 dimension_stern: 0_u16,
5086 tslc: 0_u16,
5087 flags: AisFlags::DEFAULT,
5088 turn_rate: 0_i8,
5089 navigational_status: AisNavStatus::DEFAULT,
5090 mavtype: AisType::DEFAULT,
5091 dimension_port: 0_u8,
5092 dimension_starboard: 0_u8,
5093 callsign: [0_u8; 7usize],
5094 name: [0_u8; 20usize],
5095 };
5096 #[cfg(feature = "arbitrary")]
5097 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5098 use arbitrary::{Arbitrary, Unstructured};
5099 let mut buf = [0u8; 1024];
5100 rng.fill_bytes(&mut buf);
5101 let mut unstructured = Unstructured::new(&buf);
5102 Self::arbitrary(&mut unstructured).unwrap_or_default()
5103 }
5104}
5105impl Default for AIS_VESSEL_DATA {
5106 fn default() -> Self {
5107 Self::DEFAULT.clone()
5108 }
5109}
5110impl MessageData for AIS_VESSEL_DATA {
5111 type Message = MavMessage;
5112 const ID: u32 = 301u32;
5113 const NAME: &'static str = "AIS_VESSEL";
5114 const EXTRA_CRC: u8 = 243u8;
5115 const ENCODED_LEN: usize = 58usize;
5116 fn deser(
5117 _version: MavlinkVersion,
5118 __input: &[u8],
5119 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5120 let avail_len = __input.len();
5121 let mut payload_buf = [0; Self::ENCODED_LEN];
5122 let mut buf = if avail_len < Self::ENCODED_LEN {
5123 payload_buf[0..avail_len].copy_from_slice(__input);
5124 Bytes::new(&payload_buf)
5125 } else {
5126 Bytes::new(__input)
5127 };
5128 let mut __struct = Self::default();
5129 __struct.MMSI = buf.get_u32_le();
5130 __struct.lat = buf.get_i32_le();
5131 __struct.lon = buf.get_i32_le();
5132 __struct.COG = buf.get_u16_le();
5133 __struct.heading = buf.get_u16_le();
5134 __struct.velocity = buf.get_u16_le();
5135 __struct.dimension_bow = buf.get_u16_le();
5136 __struct.dimension_stern = buf.get_u16_le();
5137 __struct.tslc = buf.get_u16_le();
5138 let tmp = buf.get_u16_le();
5139 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
5140 ::mavlink_core::error::ParserError::InvalidFlag {
5141 flag_type: "AisFlags",
5142 value: tmp as u32,
5143 },
5144 )?;
5145 __struct.turn_rate = buf.get_i8();
5146 let tmp = buf.get_u8();
5147 __struct.navigational_status =
5148 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5149 enum_type: "AisNavStatus",
5150 value: tmp as u32,
5151 })?;
5152 let tmp = buf.get_u8();
5153 __struct.mavtype =
5154 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5155 enum_type: "AisType",
5156 value: tmp as u32,
5157 })?;
5158 __struct.dimension_port = buf.get_u8();
5159 __struct.dimension_starboard = buf.get_u8();
5160 for v in &mut __struct.callsign {
5161 let val = buf.get_u8();
5162 *v = val;
5163 }
5164 for v in &mut __struct.name {
5165 let val = buf.get_u8();
5166 *v = val;
5167 }
5168 Ok(__struct)
5169 }
5170 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5171 let mut __tmp = BytesMut::new(bytes);
5172 #[allow(clippy::absurd_extreme_comparisons)]
5173 #[allow(unused_comparisons)]
5174 if __tmp.remaining() < Self::ENCODED_LEN {
5175 panic!(
5176 "buffer is too small (need {} bytes, but got {})",
5177 Self::ENCODED_LEN,
5178 __tmp.remaining(),
5179 )
5180 }
5181 __tmp.put_u32_le(self.MMSI);
5182 __tmp.put_i32_le(self.lat);
5183 __tmp.put_i32_le(self.lon);
5184 __tmp.put_u16_le(self.COG);
5185 __tmp.put_u16_le(self.heading);
5186 __tmp.put_u16_le(self.velocity);
5187 __tmp.put_u16_le(self.dimension_bow);
5188 __tmp.put_u16_le(self.dimension_stern);
5189 __tmp.put_u16_le(self.tslc);
5190 __tmp.put_u16_le(self.flags.bits());
5191 __tmp.put_i8(self.turn_rate);
5192 __tmp.put_u8(self.navigational_status as u8);
5193 __tmp.put_u8(self.mavtype as u8);
5194 __tmp.put_u8(self.dimension_port);
5195 __tmp.put_u8(self.dimension_starboard);
5196 for val in &self.callsign {
5197 __tmp.put_u8(*val);
5198 }
5199 for val in &self.name {
5200 __tmp.put_u8(*val);
5201 }
5202 if matches!(version, MavlinkVersion::V2) {
5203 let len = __tmp.len();
5204 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5205 } else {
5206 __tmp.len()
5207 }
5208 }
5209}
5210#[doc = "The current system altitude."]
5211#[doc = ""]
5212#[doc = "ID: 141"]
5213#[derive(Debug, Clone, PartialEq)]
5214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5216#[cfg_attr(feature = "ts", derive(TS))]
5217#[cfg_attr(feature = "ts", ts(export))]
5218pub struct ALTITUDE_DATA {
5219 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5220 pub time_usec: u64,
5221 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5222 pub altitude_monotonic: f32,
5223 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5224 pub altitude_amsl: f32,
5225 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5226 pub altitude_local: f32,
5227 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5228 pub altitude_relative: f32,
5229 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5230 pub altitude_terrain: f32,
5231 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5232 pub bottom_clearance: f32,
5233}
5234impl ALTITUDE_DATA {
5235 pub const ENCODED_LEN: usize = 32usize;
5236 pub const DEFAULT: Self = Self {
5237 time_usec: 0_u64,
5238 altitude_monotonic: 0.0_f32,
5239 altitude_amsl: 0.0_f32,
5240 altitude_local: 0.0_f32,
5241 altitude_relative: 0.0_f32,
5242 altitude_terrain: 0.0_f32,
5243 bottom_clearance: 0.0_f32,
5244 };
5245 #[cfg(feature = "arbitrary")]
5246 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5247 use arbitrary::{Arbitrary, Unstructured};
5248 let mut buf = [0u8; 1024];
5249 rng.fill_bytes(&mut buf);
5250 let mut unstructured = Unstructured::new(&buf);
5251 Self::arbitrary(&mut unstructured).unwrap_or_default()
5252 }
5253}
5254impl Default for ALTITUDE_DATA {
5255 fn default() -> Self {
5256 Self::DEFAULT.clone()
5257 }
5258}
5259impl MessageData for ALTITUDE_DATA {
5260 type Message = MavMessage;
5261 const ID: u32 = 141u32;
5262 const NAME: &'static str = "ALTITUDE";
5263 const EXTRA_CRC: u8 = 47u8;
5264 const ENCODED_LEN: usize = 32usize;
5265 fn deser(
5266 _version: MavlinkVersion,
5267 __input: &[u8],
5268 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5269 let avail_len = __input.len();
5270 let mut payload_buf = [0; Self::ENCODED_LEN];
5271 let mut buf = if avail_len < Self::ENCODED_LEN {
5272 payload_buf[0..avail_len].copy_from_slice(__input);
5273 Bytes::new(&payload_buf)
5274 } else {
5275 Bytes::new(__input)
5276 };
5277 let mut __struct = Self::default();
5278 __struct.time_usec = buf.get_u64_le();
5279 __struct.altitude_monotonic = buf.get_f32_le();
5280 __struct.altitude_amsl = buf.get_f32_le();
5281 __struct.altitude_local = buf.get_f32_le();
5282 __struct.altitude_relative = buf.get_f32_le();
5283 __struct.altitude_terrain = buf.get_f32_le();
5284 __struct.bottom_clearance = buf.get_f32_le();
5285 Ok(__struct)
5286 }
5287 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5288 let mut __tmp = BytesMut::new(bytes);
5289 #[allow(clippy::absurd_extreme_comparisons)]
5290 #[allow(unused_comparisons)]
5291 if __tmp.remaining() < Self::ENCODED_LEN {
5292 panic!(
5293 "buffer is too small (need {} bytes, but got {})",
5294 Self::ENCODED_LEN,
5295 __tmp.remaining(),
5296 )
5297 }
5298 __tmp.put_u64_le(self.time_usec);
5299 __tmp.put_f32_le(self.altitude_monotonic);
5300 __tmp.put_f32_le(self.altitude_amsl);
5301 __tmp.put_f32_le(self.altitude_local);
5302 __tmp.put_f32_le(self.altitude_relative);
5303 __tmp.put_f32_le(self.altitude_terrain);
5304 __tmp.put_f32_le(self.bottom_clearance);
5305 if matches!(version, MavlinkVersion::V2) {
5306 let len = __tmp.len();
5307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5308 } else {
5309 __tmp.len()
5310 }
5311 }
5312}
5313#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5314#[doc = ""]
5315#[doc = "ID: 30"]
5316#[derive(Debug, Clone, PartialEq)]
5317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5319#[cfg_attr(feature = "ts", derive(TS))]
5320#[cfg_attr(feature = "ts", ts(export))]
5321pub struct ATTITUDE_DATA {
5322 #[doc = "Timestamp (time since system boot)."]
5323 pub time_boot_ms: u32,
5324 #[doc = "Roll angle (-pi..+pi)"]
5325 pub roll: f32,
5326 #[doc = "Pitch angle (-pi..+pi)"]
5327 pub pitch: f32,
5328 #[doc = "Yaw angle (-pi..+pi)"]
5329 pub yaw: f32,
5330 #[doc = "Roll angular speed"]
5331 pub rollspeed: f32,
5332 #[doc = "Pitch angular speed"]
5333 pub pitchspeed: f32,
5334 #[doc = "Yaw angular speed"]
5335 pub yawspeed: f32,
5336}
5337impl ATTITUDE_DATA {
5338 pub const ENCODED_LEN: usize = 28usize;
5339 pub const DEFAULT: Self = Self {
5340 time_boot_ms: 0_u32,
5341 roll: 0.0_f32,
5342 pitch: 0.0_f32,
5343 yaw: 0.0_f32,
5344 rollspeed: 0.0_f32,
5345 pitchspeed: 0.0_f32,
5346 yawspeed: 0.0_f32,
5347 };
5348 #[cfg(feature = "arbitrary")]
5349 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5350 use arbitrary::{Arbitrary, Unstructured};
5351 let mut buf = [0u8; 1024];
5352 rng.fill_bytes(&mut buf);
5353 let mut unstructured = Unstructured::new(&buf);
5354 Self::arbitrary(&mut unstructured).unwrap_or_default()
5355 }
5356}
5357impl Default for ATTITUDE_DATA {
5358 fn default() -> Self {
5359 Self::DEFAULT.clone()
5360 }
5361}
5362impl MessageData for ATTITUDE_DATA {
5363 type Message = MavMessage;
5364 const ID: u32 = 30u32;
5365 const NAME: &'static str = "ATTITUDE";
5366 const EXTRA_CRC: u8 = 39u8;
5367 const ENCODED_LEN: usize = 28usize;
5368 fn deser(
5369 _version: MavlinkVersion,
5370 __input: &[u8],
5371 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5372 let avail_len = __input.len();
5373 let mut payload_buf = [0; Self::ENCODED_LEN];
5374 let mut buf = if avail_len < Self::ENCODED_LEN {
5375 payload_buf[0..avail_len].copy_from_slice(__input);
5376 Bytes::new(&payload_buf)
5377 } else {
5378 Bytes::new(__input)
5379 };
5380 let mut __struct = Self::default();
5381 __struct.time_boot_ms = buf.get_u32_le();
5382 __struct.roll = buf.get_f32_le();
5383 __struct.pitch = buf.get_f32_le();
5384 __struct.yaw = buf.get_f32_le();
5385 __struct.rollspeed = buf.get_f32_le();
5386 __struct.pitchspeed = buf.get_f32_le();
5387 __struct.yawspeed = buf.get_f32_le();
5388 Ok(__struct)
5389 }
5390 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5391 let mut __tmp = BytesMut::new(bytes);
5392 #[allow(clippy::absurd_extreme_comparisons)]
5393 #[allow(unused_comparisons)]
5394 if __tmp.remaining() < Self::ENCODED_LEN {
5395 panic!(
5396 "buffer is too small (need {} bytes, but got {})",
5397 Self::ENCODED_LEN,
5398 __tmp.remaining(),
5399 )
5400 }
5401 __tmp.put_u32_le(self.time_boot_ms);
5402 __tmp.put_f32_le(self.roll);
5403 __tmp.put_f32_le(self.pitch);
5404 __tmp.put_f32_le(self.yaw);
5405 __tmp.put_f32_le(self.rollspeed);
5406 __tmp.put_f32_le(self.pitchspeed);
5407 __tmp.put_f32_le(self.yawspeed);
5408 if matches!(version, MavlinkVersion::V2) {
5409 let len = __tmp.len();
5410 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5411 } else {
5412 __tmp.len()
5413 }
5414 }
5415}
5416#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5417#[doc = ""]
5418#[doc = "ID: 31"]
5419#[derive(Debug, Clone, PartialEq)]
5420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5422#[cfg_attr(feature = "ts", derive(TS))]
5423#[cfg_attr(feature = "ts", ts(export))]
5424pub struct ATTITUDE_QUATERNION_DATA {
5425 #[doc = "Timestamp (time since system boot)."]
5426 pub time_boot_ms: u32,
5427 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5428 pub q1: f32,
5429 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5430 pub q2: f32,
5431 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5432 pub q3: f32,
5433 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5434 pub q4: f32,
5435 #[doc = "Roll angular speed"]
5436 pub rollspeed: f32,
5437 #[doc = "Pitch angular speed"]
5438 pub pitchspeed: f32,
5439 #[doc = "Yaw angular speed"]
5440 pub yawspeed: f32,
5441 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5442 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5443 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5444 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5445 pub repr_offset_q: [f32; 4],
5446}
5447impl ATTITUDE_QUATERNION_DATA {
5448 pub const ENCODED_LEN: usize = 48usize;
5449 pub const DEFAULT: Self = Self {
5450 time_boot_ms: 0_u32,
5451 q1: 0.0_f32,
5452 q2: 0.0_f32,
5453 q3: 0.0_f32,
5454 q4: 0.0_f32,
5455 rollspeed: 0.0_f32,
5456 pitchspeed: 0.0_f32,
5457 yawspeed: 0.0_f32,
5458 repr_offset_q: [0.0_f32; 4usize],
5459 };
5460 #[cfg(feature = "arbitrary")]
5461 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5462 use arbitrary::{Arbitrary, Unstructured};
5463 let mut buf = [0u8; 1024];
5464 rng.fill_bytes(&mut buf);
5465 let mut unstructured = Unstructured::new(&buf);
5466 Self::arbitrary(&mut unstructured).unwrap_or_default()
5467 }
5468}
5469impl Default for ATTITUDE_QUATERNION_DATA {
5470 fn default() -> Self {
5471 Self::DEFAULT.clone()
5472 }
5473}
5474impl MessageData for ATTITUDE_QUATERNION_DATA {
5475 type Message = MavMessage;
5476 const ID: u32 = 31u32;
5477 const NAME: &'static str = "ATTITUDE_QUATERNION";
5478 const EXTRA_CRC: u8 = 246u8;
5479 const ENCODED_LEN: usize = 48usize;
5480 fn deser(
5481 _version: MavlinkVersion,
5482 __input: &[u8],
5483 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5484 let avail_len = __input.len();
5485 let mut payload_buf = [0; Self::ENCODED_LEN];
5486 let mut buf = if avail_len < Self::ENCODED_LEN {
5487 payload_buf[0..avail_len].copy_from_slice(__input);
5488 Bytes::new(&payload_buf)
5489 } else {
5490 Bytes::new(__input)
5491 };
5492 let mut __struct = Self::default();
5493 __struct.time_boot_ms = buf.get_u32_le();
5494 __struct.q1 = buf.get_f32_le();
5495 __struct.q2 = buf.get_f32_le();
5496 __struct.q3 = buf.get_f32_le();
5497 __struct.q4 = buf.get_f32_le();
5498 __struct.rollspeed = buf.get_f32_le();
5499 __struct.pitchspeed = buf.get_f32_le();
5500 __struct.yawspeed = buf.get_f32_le();
5501 for v in &mut __struct.repr_offset_q {
5502 let val = buf.get_f32_le();
5503 *v = val;
5504 }
5505 Ok(__struct)
5506 }
5507 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5508 let mut __tmp = BytesMut::new(bytes);
5509 #[allow(clippy::absurd_extreme_comparisons)]
5510 #[allow(unused_comparisons)]
5511 if __tmp.remaining() < Self::ENCODED_LEN {
5512 panic!(
5513 "buffer is too small (need {} bytes, but got {})",
5514 Self::ENCODED_LEN,
5515 __tmp.remaining(),
5516 )
5517 }
5518 __tmp.put_u32_le(self.time_boot_ms);
5519 __tmp.put_f32_le(self.q1);
5520 __tmp.put_f32_le(self.q2);
5521 __tmp.put_f32_le(self.q3);
5522 __tmp.put_f32_le(self.q4);
5523 __tmp.put_f32_le(self.rollspeed);
5524 __tmp.put_f32_le(self.pitchspeed);
5525 __tmp.put_f32_le(self.yawspeed);
5526 if matches!(version, MavlinkVersion::V2) {
5527 for val in &self.repr_offset_q {
5528 __tmp.put_f32_le(*val);
5529 }
5530 let len = __tmp.len();
5531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5532 } else {
5533 __tmp.len()
5534 }
5535 }
5536}
5537#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5538#[doc = ""]
5539#[doc = "ID: 61"]
5540#[derive(Debug, Clone, PartialEq)]
5541#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5542#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5543#[cfg_attr(feature = "ts", derive(TS))]
5544#[cfg_attr(feature = "ts", ts(export))]
5545pub struct ATTITUDE_QUATERNION_COV_DATA {
5546 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5547 pub time_usec: u64,
5548 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5549 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5550 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5551 pub q: [f32; 4],
5552 #[doc = "Roll angular speed"]
5553 pub rollspeed: f32,
5554 #[doc = "Pitch angular speed"]
5555 pub pitchspeed: f32,
5556 #[doc = "Yaw angular speed"]
5557 pub yawspeed: f32,
5558 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5559 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5560 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5561 pub covariance: [f32; 9],
5562}
5563impl ATTITUDE_QUATERNION_COV_DATA {
5564 pub const ENCODED_LEN: usize = 72usize;
5565 pub const DEFAULT: Self = Self {
5566 time_usec: 0_u64,
5567 q: [0.0_f32; 4usize],
5568 rollspeed: 0.0_f32,
5569 pitchspeed: 0.0_f32,
5570 yawspeed: 0.0_f32,
5571 covariance: [0.0_f32; 9usize],
5572 };
5573 #[cfg(feature = "arbitrary")]
5574 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5575 use arbitrary::{Arbitrary, Unstructured};
5576 let mut buf = [0u8; 1024];
5577 rng.fill_bytes(&mut buf);
5578 let mut unstructured = Unstructured::new(&buf);
5579 Self::arbitrary(&mut unstructured).unwrap_or_default()
5580 }
5581}
5582impl Default for ATTITUDE_QUATERNION_COV_DATA {
5583 fn default() -> Self {
5584 Self::DEFAULT.clone()
5585 }
5586}
5587impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5588 type Message = MavMessage;
5589 const ID: u32 = 61u32;
5590 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5591 const EXTRA_CRC: u8 = 167u8;
5592 const ENCODED_LEN: usize = 72usize;
5593 fn deser(
5594 _version: MavlinkVersion,
5595 __input: &[u8],
5596 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5597 let avail_len = __input.len();
5598 let mut payload_buf = [0; Self::ENCODED_LEN];
5599 let mut buf = if avail_len < Self::ENCODED_LEN {
5600 payload_buf[0..avail_len].copy_from_slice(__input);
5601 Bytes::new(&payload_buf)
5602 } else {
5603 Bytes::new(__input)
5604 };
5605 let mut __struct = Self::default();
5606 __struct.time_usec = buf.get_u64_le();
5607 for v in &mut __struct.q {
5608 let val = buf.get_f32_le();
5609 *v = val;
5610 }
5611 __struct.rollspeed = buf.get_f32_le();
5612 __struct.pitchspeed = buf.get_f32_le();
5613 __struct.yawspeed = buf.get_f32_le();
5614 for v in &mut __struct.covariance {
5615 let val = buf.get_f32_le();
5616 *v = val;
5617 }
5618 Ok(__struct)
5619 }
5620 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5621 let mut __tmp = BytesMut::new(bytes);
5622 #[allow(clippy::absurd_extreme_comparisons)]
5623 #[allow(unused_comparisons)]
5624 if __tmp.remaining() < Self::ENCODED_LEN {
5625 panic!(
5626 "buffer is too small (need {} bytes, but got {})",
5627 Self::ENCODED_LEN,
5628 __tmp.remaining(),
5629 )
5630 }
5631 __tmp.put_u64_le(self.time_usec);
5632 for val in &self.q {
5633 __tmp.put_f32_le(*val);
5634 }
5635 __tmp.put_f32_le(self.rollspeed);
5636 __tmp.put_f32_le(self.pitchspeed);
5637 __tmp.put_f32_le(self.yawspeed);
5638 for val in &self.covariance {
5639 __tmp.put_f32_le(*val);
5640 }
5641 if matches!(version, MavlinkVersion::V2) {
5642 let len = __tmp.len();
5643 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5644 } else {
5645 __tmp.len()
5646 }
5647 }
5648}
5649#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5650#[doc = ""]
5651#[doc = "ID: 83"]
5652#[derive(Debug, Clone, PartialEq)]
5653#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5654#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5655#[cfg_attr(feature = "ts", derive(TS))]
5656#[cfg_attr(feature = "ts", ts(export))]
5657pub struct ATTITUDE_TARGET_DATA {
5658 #[doc = "Timestamp (time since system boot)."]
5659 pub time_boot_ms: u32,
5660 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5661 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5662 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5663 pub q: [f32; 4],
5664 #[doc = "Body roll rate"]
5665 pub body_roll_rate: f32,
5666 #[doc = "Body pitch rate"]
5667 pub body_pitch_rate: f32,
5668 #[doc = "Body yaw rate"]
5669 pub body_yaw_rate: f32,
5670 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5671 pub thrust: f32,
5672 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5673 pub type_mask: AttitudeTargetTypemask,
5674}
5675impl ATTITUDE_TARGET_DATA {
5676 pub const ENCODED_LEN: usize = 37usize;
5677 pub const DEFAULT: Self = Self {
5678 time_boot_ms: 0_u32,
5679 q: [0.0_f32; 4usize],
5680 body_roll_rate: 0.0_f32,
5681 body_pitch_rate: 0.0_f32,
5682 body_yaw_rate: 0.0_f32,
5683 thrust: 0.0_f32,
5684 type_mask: AttitudeTargetTypemask::DEFAULT,
5685 };
5686 #[cfg(feature = "arbitrary")]
5687 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5688 use arbitrary::{Arbitrary, Unstructured};
5689 let mut buf = [0u8; 1024];
5690 rng.fill_bytes(&mut buf);
5691 let mut unstructured = Unstructured::new(&buf);
5692 Self::arbitrary(&mut unstructured).unwrap_or_default()
5693 }
5694}
5695impl Default for ATTITUDE_TARGET_DATA {
5696 fn default() -> Self {
5697 Self::DEFAULT.clone()
5698 }
5699}
5700impl MessageData for ATTITUDE_TARGET_DATA {
5701 type Message = MavMessage;
5702 const ID: u32 = 83u32;
5703 const NAME: &'static str = "ATTITUDE_TARGET";
5704 const EXTRA_CRC: u8 = 22u8;
5705 const ENCODED_LEN: usize = 37usize;
5706 fn deser(
5707 _version: MavlinkVersion,
5708 __input: &[u8],
5709 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5710 let avail_len = __input.len();
5711 let mut payload_buf = [0; Self::ENCODED_LEN];
5712 let mut buf = if avail_len < Self::ENCODED_LEN {
5713 payload_buf[0..avail_len].copy_from_slice(__input);
5714 Bytes::new(&payload_buf)
5715 } else {
5716 Bytes::new(__input)
5717 };
5718 let mut __struct = Self::default();
5719 __struct.time_boot_ms = buf.get_u32_le();
5720 for v in &mut __struct.q {
5721 let val = buf.get_f32_le();
5722 *v = val;
5723 }
5724 __struct.body_roll_rate = buf.get_f32_le();
5725 __struct.body_pitch_rate = buf.get_f32_le();
5726 __struct.body_yaw_rate = buf.get_f32_le();
5727 __struct.thrust = buf.get_f32_le();
5728 let tmp = buf.get_u8();
5729 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5730 tmp & AttitudeTargetTypemask::all().bits(),
5731 )
5732 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5733 flag_type: "AttitudeTargetTypemask",
5734 value: tmp as u32,
5735 })?;
5736 Ok(__struct)
5737 }
5738 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5739 let mut __tmp = BytesMut::new(bytes);
5740 #[allow(clippy::absurd_extreme_comparisons)]
5741 #[allow(unused_comparisons)]
5742 if __tmp.remaining() < Self::ENCODED_LEN {
5743 panic!(
5744 "buffer is too small (need {} bytes, but got {})",
5745 Self::ENCODED_LEN,
5746 __tmp.remaining(),
5747 )
5748 }
5749 __tmp.put_u32_le(self.time_boot_ms);
5750 for val in &self.q {
5751 __tmp.put_f32_le(*val);
5752 }
5753 __tmp.put_f32_le(self.body_roll_rate);
5754 __tmp.put_f32_le(self.body_pitch_rate);
5755 __tmp.put_f32_le(self.body_yaw_rate);
5756 __tmp.put_f32_le(self.thrust);
5757 __tmp.put_u8(self.type_mask.bits());
5758 if matches!(version, MavlinkVersion::V2) {
5759 let len = __tmp.len();
5760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5761 } else {
5762 __tmp.len()
5763 }
5764 }
5765}
5766#[doc = "Motion capture attitude and position."]
5767#[doc = ""]
5768#[doc = "ID: 138"]
5769#[derive(Debug, Clone, PartialEq)]
5770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5772#[cfg_attr(feature = "ts", derive(TS))]
5773#[cfg_attr(feature = "ts", ts(export))]
5774pub struct ATT_POS_MOCAP_DATA {
5775 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5776 pub time_usec: u64,
5777 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5778 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5779 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5780 pub q: [f32; 4],
5781 #[doc = "X position (NED)"]
5782 pub x: f32,
5783 #[doc = "Y position (NED)"]
5784 pub y: f32,
5785 #[doc = "Z position (NED)"]
5786 pub z: f32,
5787 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5788 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5789 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5790 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5791 pub covariance: [f32; 21],
5792}
5793impl ATT_POS_MOCAP_DATA {
5794 pub const ENCODED_LEN: usize = 120usize;
5795 pub const DEFAULT: Self = Self {
5796 time_usec: 0_u64,
5797 q: [0.0_f32; 4usize],
5798 x: 0.0_f32,
5799 y: 0.0_f32,
5800 z: 0.0_f32,
5801 covariance: [0.0_f32; 21usize],
5802 };
5803 #[cfg(feature = "arbitrary")]
5804 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5805 use arbitrary::{Arbitrary, Unstructured};
5806 let mut buf = [0u8; 1024];
5807 rng.fill_bytes(&mut buf);
5808 let mut unstructured = Unstructured::new(&buf);
5809 Self::arbitrary(&mut unstructured).unwrap_or_default()
5810 }
5811}
5812impl Default for ATT_POS_MOCAP_DATA {
5813 fn default() -> Self {
5814 Self::DEFAULT.clone()
5815 }
5816}
5817impl MessageData for ATT_POS_MOCAP_DATA {
5818 type Message = MavMessage;
5819 const ID: u32 = 138u32;
5820 const NAME: &'static str = "ATT_POS_MOCAP";
5821 const EXTRA_CRC: u8 = 109u8;
5822 const ENCODED_LEN: usize = 120usize;
5823 fn deser(
5824 _version: MavlinkVersion,
5825 __input: &[u8],
5826 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5827 let avail_len = __input.len();
5828 let mut payload_buf = [0; Self::ENCODED_LEN];
5829 let mut buf = if avail_len < Self::ENCODED_LEN {
5830 payload_buf[0..avail_len].copy_from_slice(__input);
5831 Bytes::new(&payload_buf)
5832 } else {
5833 Bytes::new(__input)
5834 };
5835 let mut __struct = Self::default();
5836 __struct.time_usec = buf.get_u64_le();
5837 for v in &mut __struct.q {
5838 let val = buf.get_f32_le();
5839 *v = val;
5840 }
5841 __struct.x = buf.get_f32_le();
5842 __struct.y = buf.get_f32_le();
5843 __struct.z = buf.get_f32_le();
5844 for v in &mut __struct.covariance {
5845 let val = buf.get_f32_le();
5846 *v = val;
5847 }
5848 Ok(__struct)
5849 }
5850 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5851 let mut __tmp = BytesMut::new(bytes);
5852 #[allow(clippy::absurd_extreme_comparisons)]
5853 #[allow(unused_comparisons)]
5854 if __tmp.remaining() < Self::ENCODED_LEN {
5855 panic!(
5856 "buffer is too small (need {} bytes, but got {})",
5857 Self::ENCODED_LEN,
5858 __tmp.remaining(),
5859 )
5860 }
5861 __tmp.put_u64_le(self.time_usec);
5862 for val in &self.q {
5863 __tmp.put_f32_le(*val);
5864 }
5865 __tmp.put_f32_le(self.x);
5866 __tmp.put_f32_le(self.y);
5867 __tmp.put_f32_le(self.z);
5868 if matches!(version, MavlinkVersion::V2) {
5869 for val in &self.covariance {
5870 __tmp.put_f32_le(*val);
5871 }
5872 let len = __tmp.len();
5873 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5874 } else {
5875 __tmp.len()
5876 }
5877 }
5878}
5879#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5880#[doc = ""]
5881#[doc = "ID: 7"]
5882#[derive(Debug, Clone, PartialEq)]
5883#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5884#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5885#[cfg_attr(feature = "ts", derive(TS))]
5886#[cfg_attr(feature = "ts", ts(export))]
5887pub struct AUTH_KEY_DATA {
5888 #[doc = "key"]
5889 #[cfg_attr(
5890 feature = "serde",
5891 serde(
5892 serialize_with = "crate::nulstr::serialize::<_, 32>",
5893 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
5894 )
5895 )]
5896 #[cfg_attr(feature = "ts", ts(type = "string"))]
5897 pub key: [u8; 32],
5898}
5899impl AUTH_KEY_DATA {
5900 pub const ENCODED_LEN: usize = 32usize;
5901 pub const DEFAULT: Self = Self {
5902 key: [0_u8; 32usize],
5903 };
5904 #[cfg(feature = "arbitrary")]
5905 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5906 use arbitrary::{Arbitrary, Unstructured};
5907 let mut buf = [0u8; 1024];
5908 rng.fill_bytes(&mut buf);
5909 let mut unstructured = Unstructured::new(&buf);
5910 Self::arbitrary(&mut unstructured).unwrap_or_default()
5911 }
5912}
5913impl Default for AUTH_KEY_DATA {
5914 fn default() -> Self {
5915 Self::DEFAULT.clone()
5916 }
5917}
5918impl MessageData for AUTH_KEY_DATA {
5919 type Message = MavMessage;
5920 const ID: u32 = 7u32;
5921 const NAME: &'static str = "AUTH_KEY";
5922 const EXTRA_CRC: u8 = 119u8;
5923 const ENCODED_LEN: usize = 32usize;
5924 fn deser(
5925 _version: MavlinkVersion,
5926 __input: &[u8],
5927 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5928 let avail_len = __input.len();
5929 let mut payload_buf = [0; Self::ENCODED_LEN];
5930 let mut buf = if avail_len < Self::ENCODED_LEN {
5931 payload_buf[0..avail_len].copy_from_slice(__input);
5932 Bytes::new(&payload_buf)
5933 } else {
5934 Bytes::new(__input)
5935 };
5936 let mut __struct = Self::default();
5937 for v in &mut __struct.key {
5938 let val = buf.get_u8();
5939 *v = val;
5940 }
5941 Ok(__struct)
5942 }
5943 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5944 let mut __tmp = BytesMut::new(bytes);
5945 #[allow(clippy::absurd_extreme_comparisons)]
5946 #[allow(unused_comparisons)]
5947 if __tmp.remaining() < Self::ENCODED_LEN {
5948 panic!(
5949 "buffer is too small (need {} bytes, but got {})",
5950 Self::ENCODED_LEN,
5951 __tmp.remaining(),
5952 )
5953 }
5954 for val in &self.key {
5955 __tmp.put_u8(*val);
5956 }
5957 if matches!(version, MavlinkVersion::V2) {
5958 let len = __tmp.len();
5959 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5960 } else {
5961 __tmp.len()
5962 }
5963 }
5964}
5965#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5966#[doc = ""]
5967#[doc = "ID: 286"]
5968#[derive(Debug, Clone, PartialEq)]
5969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5970#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5971#[cfg_attr(feature = "ts", derive(TS))]
5972#[cfg_attr(feature = "ts", ts(export))]
5973pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5974 #[doc = "Timestamp (time since system boot)."]
5975 pub time_boot_us: u64,
5976 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5977 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5978 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5979 pub q: [f32; 4],
5980 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5981 pub q_estimated_delay_us: u32,
5982 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5983 pub vx: f32,
5984 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5985 pub vy: f32,
5986 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5987 pub vz: f32,
5988 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5989 pub v_estimated_delay_us: u32,
5990 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5991 pub feed_forward_angular_velocity_z: f32,
5992 #[doc = "Bitmap indicating which estimator outputs are valid."]
5993 pub estimator_status: EstimatorStatusFlags,
5994 #[doc = "System ID"]
5995 pub target_system: u8,
5996 #[doc = "Component ID"]
5997 pub target_component: u8,
5998 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5999 pub landed_state: MavLandedState,
6000 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6001 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6002 pub angular_velocity_z: f32,
6003}
6004impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6005 pub const ENCODED_LEN: usize = 57usize;
6006 pub const DEFAULT: Self = Self {
6007 time_boot_us: 0_u64,
6008 q: [0.0_f32; 4usize],
6009 q_estimated_delay_us: 0_u32,
6010 vx: 0.0_f32,
6011 vy: 0.0_f32,
6012 vz: 0.0_f32,
6013 v_estimated_delay_us: 0_u32,
6014 feed_forward_angular_velocity_z: 0.0_f32,
6015 estimator_status: EstimatorStatusFlags::DEFAULT,
6016 target_system: 0_u8,
6017 target_component: 0_u8,
6018 landed_state: MavLandedState::DEFAULT,
6019 angular_velocity_z: 0.0_f32,
6020 };
6021 #[cfg(feature = "arbitrary")]
6022 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6023 use arbitrary::{Arbitrary, Unstructured};
6024 let mut buf = [0u8; 1024];
6025 rng.fill_bytes(&mut buf);
6026 let mut unstructured = Unstructured::new(&buf);
6027 Self::arbitrary(&mut unstructured).unwrap_or_default()
6028 }
6029}
6030impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6031 fn default() -> Self {
6032 Self::DEFAULT.clone()
6033 }
6034}
6035impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6036 type Message = MavMessage;
6037 const ID: u32 = 286u32;
6038 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6039 const EXTRA_CRC: u8 = 210u8;
6040 const ENCODED_LEN: usize = 57usize;
6041 fn deser(
6042 _version: MavlinkVersion,
6043 __input: &[u8],
6044 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6045 let avail_len = __input.len();
6046 let mut payload_buf = [0; Self::ENCODED_LEN];
6047 let mut buf = if avail_len < Self::ENCODED_LEN {
6048 payload_buf[0..avail_len].copy_from_slice(__input);
6049 Bytes::new(&payload_buf)
6050 } else {
6051 Bytes::new(__input)
6052 };
6053 let mut __struct = Self::default();
6054 __struct.time_boot_us = buf.get_u64_le();
6055 for v in &mut __struct.q {
6056 let val = buf.get_f32_le();
6057 *v = val;
6058 }
6059 __struct.q_estimated_delay_us = buf.get_u32_le();
6060 __struct.vx = buf.get_f32_le();
6061 __struct.vy = buf.get_f32_le();
6062 __struct.vz = buf.get_f32_le();
6063 __struct.v_estimated_delay_us = buf.get_u32_le();
6064 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6065 let tmp = buf.get_u16_le();
6066 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6067 tmp & EstimatorStatusFlags::all().bits(),
6068 )
6069 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6070 flag_type: "EstimatorStatusFlags",
6071 value: tmp as u32,
6072 })?;
6073 __struct.target_system = buf.get_u8();
6074 __struct.target_component = buf.get_u8();
6075 let tmp = buf.get_u8();
6076 __struct.landed_state =
6077 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6078 enum_type: "MavLandedState",
6079 value: tmp as u32,
6080 })?;
6081 __struct.angular_velocity_z = buf.get_f32_le();
6082 Ok(__struct)
6083 }
6084 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6085 let mut __tmp = BytesMut::new(bytes);
6086 #[allow(clippy::absurd_extreme_comparisons)]
6087 #[allow(unused_comparisons)]
6088 if __tmp.remaining() < Self::ENCODED_LEN {
6089 panic!(
6090 "buffer is too small (need {} bytes, but got {})",
6091 Self::ENCODED_LEN,
6092 __tmp.remaining(),
6093 )
6094 }
6095 __tmp.put_u64_le(self.time_boot_us);
6096 for val in &self.q {
6097 __tmp.put_f32_le(*val);
6098 }
6099 __tmp.put_u32_le(self.q_estimated_delay_us);
6100 __tmp.put_f32_le(self.vx);
6101 __tmp.put_f32_le(self.vy);
6102 __tmp.put_f32_le(self.vz);
6103 __tmp.put_u32_le(self.v_estimated_delay_us);
6104 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6105 __tmp.put_u16_le(self.estimator_status.bits());
6106 __tmp.put_u8(self.target_system);
6107 __tmp.put_u8(self.target_component);
6108 __tmp.put_u8(self.landed_state as u8);
6109 if matches!(version, MavlinkVersion::V2) {
6110 __tmp.put_f32_le(self.angular_velocity_z);
6111 let len = __tmp.len();
6112 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6113 } else {
6114 __tmp.len()
6115 }
6116 }
6117}
6118#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6119#[doc = ""]
6120#[doc = "ID: 148"]
6121#[derive(Debug, Clone, PartialEq)]
6122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6123#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6124#[cfg_attr(feature = "ts", derive(TS))]
6125#[cfg_attr(feature = "ts", ts(export))]
6126pub struct AUTOPILOT_VERSION_DATA {
6127 #[doc = "Bitmap of capabilities"]
6128 pub capabilities: MavProtocolCapability,
6129 #[doc = "UID if provided by hardware (see uid2)"]
6130 pub uid: u64,
6131 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6132 pub flight_sw_version: u32,
6133 #[doc = "Middleware version number"]
6134 pub middleware_sw_version: u32,
6135 #[doc = "Operating system version number"]
6136 pub os_sw_version: u32,
6137 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6138 pub board_version: u32,
6139 #[doc = "ID of the board vendor"]
6140 pub vendor_id: u16,
6141 #[doc = "ID of the product"]
6142 pub product_id: u16,
6143 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6144 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6145 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6146 pub flight_custom_version: [u8; 8],
6147 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6148 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6149 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6150 pub middleware_custom_version: [u8; 8],
6151 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6152 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6153 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6154 pub os_custom_version: [u8; 8],
6155 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6156 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6157 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6158 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6159 pub uid2: [u8; 18],
6160}
6161impl AUTOPILOT_VERSION_DATA {
6162 pub const ENCODED_LEN: usize = 78usize;
6163 pub const DEFAULT: Self = Self {
6164 capabilities: MavProtocolCapability::DEFAULT,
6165 uid: 0_u64,
6166 flight_sw_version: 0_u32,
6167 middleware_sw_version: 0_u32,
6168 os_sw_version: 0_u32,
6169 board_version: 0_u32,
6170 vendor_id: 0_u16,
6171 product_id: 0_u16,
6172 flight_custom_version: [0_u8; 8usize],
6173 middleware_custom_version: [0_u8; 8usize],
6174 os_custom_version: [0_u8; 8usize],
6175 uid2: [0_u8; 18usize],
6176 };
6177 #[cfg(feature = "arbitrary")]
6178 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6179 use arbitrary::{Arbitrary, Unstructured};
6180 let mut buf = [0u8; 1024];
6181 rng.fill_bytes(&mut buf);
6182 let mut unstructured = Unstructured::new(&buf);
6183 Self::arbitrary(&mut unstructured).unwrap_or_default()
6184 }
6185}
6186impl Default for AUTOPILOT_VERSION_DATA {
6187 fn default() -> Self {
6188 Self::DEFAULT.clone()
6189 }
6190}
6191impl MessageData for AUTOPILOT_VERSION_DATA {
6192 type Message = MavMessage;
6193 const ID: u32 = 148u32;
6194 const NAME: &'static str = "AUTOPILOT_VERSION";
6195 const EXTRA_CRC: u8 = 178u8;
6196 const ENCODED_LEN: usize = 78usize;
6197 fn deser(
6198 _version: MavlinkVersion,
6199 __input: &[u8],
6200 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6201 let avail_len = __input.len();
6202 let mut payload_buf = [0; Self::ENCODED_LEN];
6203 let mut buf = if avail_len < Self::ENCODED_LEN {
6204 payload_buf[0..avail_len].copy_from_slice(__input);
6205 Bytes::new(&payload_buf)
6206 } else {
6207 Bytes::new(__input)
6208 };
6209 let mut __struct = Self::default();
6210 let tmp = buf.get_u64_le();
6211 __struct.capabilities = MavProtocolCapability::from_bits(
6212 tmp & MavProtocolCapability::all().bits(),
6213 )
6214 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6215 flag_type: "MavProtocolCapability",
6216 value: tmp as u32,
6217 })?;
6218 __struct.uid = buf.get_u64_le();
6219 __struct.flight_sw_version = buf.get_u32_le();
6220 __struct.middleware_sw_version = buf.get_u32_le();
6221 __struct.os_sw_version = buf.get_u32_le();
6222 __struct.board_version = buf.get_u32_le();
6223 __struct.vendor_id = buf.get_u16_le();
6224 __struct.product_id = buf.get_u16_le();
6225 for v in &mut __struct.flight_custom_version {
6226 let val = buf.get_u8();
6227 *v = val;
6228 }
6229 for v in &mut __struct.middleware_custom_version {
6230 let val = buf.get_u8();
6231 *v = val;
6232 }
6233 for v in &mut __struct.os_custom_version {
6234 let val = buf.get_u8();
6235 *v = val;
6236 }
6237 for v in &mut __struct.uid2 {
6238 let val = buf.get_u8();
6239 *v = val;
6240 }
6241 Ok(__struct)
6242 }
6243 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6244 let mut __tmp = BytesMut::new(bytes);
6245 #[allow(clippy::absurd_extreme_comparisons)]
6246 #[allow(unused_comparisons)]
6247 if __tmp.remaining() < Self::ENCODED_LEN {
6248 panic!(
6249 "buffer is too small (need {} bytes, but got {})",
6250 Self::ENCODED_LEN,
6251 __tmp.remaining(),
6252 )
6253 }
6254 __tmp.put_u64_le(self.capabilities.bits());
6255 __tmp.put_u64_le(self.uid);
6256 __tmp.put_u32_le(self.flight_sw_version);
6257 __tmp.put_u32_le(self.middleware_sw_version);
6258 __tmp.put_u32_le(self.os_sw_version);
6259 __tmp.put_u32_le(self.board_version);
6260 __tmp.put_u16_le(self.vendor_id);
6261 __tmp.put_u16_le(self.product_id);
6262 for val in &self.flight_custom_version {
6263 __tmp.put_u8(*val);
6264 }
6265 for val in &self.middleware_custom_version {
6266 __tmp.put_u8(*val);
6267 }
6268 for val in &self.os_custom_version {
6269 __tmp.put_u8(*val);
6270 }
6271 if matches!(version, MavlinkVersion::V2) {
6272 for val in &self.uid2 {
6273 __tmp.put_u8(*val);
6274 }
6275 let len = __tmp.len();
6276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6277 } else {
6278 __tmp.len()
6279 }
6280 }
6281}
6282#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6283#[doc = ""]
6284#[doc = "ID: 435"]
6285#[derive(Debug, Clone, PartialEq)]
6286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6288#[cfg_attr(feature = "ts", derive(TS))]
6289#[cfg_attr(feature = "ts", ts(export))]
6290pub struct AVAILABLE_MODES_DATA {
6291 #[doc = "A bitfield for use for autopilot-specific flags"]
6292 pub custom_mode: u32,
6293 #[doc = "Mode properties."]
6294 pub properties: MavModeProperty,
6295 #[doc = "The total number of available modes for the current vehicle type."]
6296 pub number_modes: u8,
6297 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6298 pub mode_index: u8,
6299 #[doc = "Standard mode."]
6300 pub standard_mode: MavStandardMode,
6301 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6302 #[cfg_attr(
6303 feature = "serde",
6304 serde(
6305 serialize_with = "crate::nulstr::serialize::<_, 35>",
6306 deserialize_with = "crate::nulstr::deserialize::<_, 35>"
6307 )
6308 )]
6309 #[cfg_attr(feature = "ts", ts(type = "string"))]
6310 pub mode_name: [u8; 35],
6311}
6312impl AVAILABLE_MODES_DATA {
6313 pub const ENCODED_LEN: usize = 46usize;
6314 pub const DEFAULT: Self = Self {
6315 custom_mode: 0_u32,
6316 properties: MavModeProperty::DEFAULT,
6317 number_modes: 0_u8,
6318 mode_index: 0_u8,
6319 standard_mode: MavStandardMode::DEFAULT,
6320 mode_name: [0_u8; 35usize],
6321 };
6322 #[cfg(feature = "arbitrary")]
6323 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6324 use arbitrary::{Arbitrary, Unstructured};
6325 let mut buf = [0u8; 1024];
6326 rng.fill_bytes(&mut buf);
6327 let mut unstructured = Unstructured::new(&buf);
6328 Self::arbitrary(&mut unstructured).unwrap_or_default()
6329 }
6330}
6331impl Default for AVAILABLE_MODES_DATA {
6332 fn default() -> Self {
6333 Self::DEFAULT.clone()
6334 }
6335}
6336impl MessageData for AVAILABLE_MODES_DATA {
6337 type Message = MavMessage;
6338 const ID: u32 = 435u32;
6339 const NAME: &'static str = "AVAILABLE_MODES";
6340 const EXTRA_CRC: u8 = 134u8;
6341 const ENCODED_LEN: usize = 46usize;
6342 fn deser(
6343 _version: MavlinkVersion,
6344 __input: &[u8],
6345 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6346 let avail_len = __input.len();
6347 let mut payload_buf = [0; Self::ENCODED_LEN];
6348 let mut buf = if avail_len < Self::ENCODED_LEN {
6349 payload_buf[0..avail_len].copy_from_slice(__input);
6350 Bytes::new(&payload_buf)
6351 } else {
6352 Bytes::new(__input)
6353 };
6354 let mut __struct = Self::default();
6355 __struct.custom_mode = buf.get_u32_le();
6356 let tmp = buf.get_u32_le();
6357 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6358 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6359 flag_type: "MavModeProperty",
6360 value: tmp as u32,
6361 })?;
6362 __struct.number_modes = buf.get_u8();
6363 __struct.mode_index = buf.get_u8();
6364 let tmp = buf.get_u8();
6365 __struct.standard_mode =
6366 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6367 enum_type: "MavStandardMode",
6368 value: tmp as u32,
6369 })?;
6370 for v in &mut __struct.mode_name {
6371 let val = buf.get_u8();
6372 *v = val;
6373 }
6374 Ok(__struct)
6375 }
6376 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6377 let mut __tmp = BytesMut::new(bytes);
6378 #[allow(clippy::absurd_extreme_comparisons)]
6379 #[allow(unused_comparisons)]
6380 if __tmp.remaining() < Self::ENCODED_LEN {
6381 panic!(
6382 "buffer is too small (need {} bytes, but got {})",
6383 Self::ENCODED_LEN,
6384 __tmp.remaining(),
6385 )
6386 }
6387 __tmp.put_u32_le(self.custom_mode);
6388 __tmp.put_u32_le(self.properties.bits());
6389 __tmp.put_u8(self.number_modes);
6390 __tmp.put_u8(self.mode_index);
6391 __tmp.put_u8(self.standard_mode as u8);
6392 for val in &self.mode_name {
6393 __tmp.put_u8(*val);
6394 }
6395 if matches!(version, MavlinkVersion::V2) {
6396 let len = __tmp.len();
6397 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6398 } else {
6399 __tmp.len()
6400 }
6401 }
6402}
6403#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6404#[doc = ""]
6405#[doc = "ID: 437"]
6406#[derive(Debug, Clone, PartialEq)]
6407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6409#[cfg_attr(feature = "ts", derive(TS))]
6410#[cfg_attr(feature = "ts", ts(export))]
6411pub struct AVAILABLE_MODES_MONITOR_DATA {
6412 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6413 pub seq: u8,
6414}
6415impl AVAILABLE_MODES_MONITOR_DATA {
6416 pub const ENCODED_LEN: usize = 1usize;
6417 pub const DEFAULT: Self = Self { seq: 0_u8 };
6418 #[cfg(feature = "arbitrary")]
6419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6420 use arbitrary::{Arbitrary, Unstructured};
6421 let mut buf = [0u8; 1024];
6422 rng.fill_bytes(&mut buf);
6423 let mut unstructured = Unstructured::new(&buf);
6424 Self::arbitrary(&mut unstructured).unwrap_or_default()
6425 }
6426}
6427impl Default for AVAILABLE_MODES_MONITOR_DATA {
6428 fn default() -> Self {
6429 Self::DEFAULT.clone()
6430 }
6431}
6432impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6433 type Message = MavMessage;
6434 const ID: u32 = 437u32;
6435 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6436 const EXTRA_CRC: u8 = 30u8;
6437 const ENCODED_LEN: usize = 1usize;
6438 fn deser(
6439 _version: MavlinkVersion,
6440 __input: &[u8],
6441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6442 let avail_len = __input.len();
6443 let mut payload_buf = [0; Self::ENCODED_LEN];
6444 let mut buf = if avail_len < Self::ENCODED_LEN {
6445 payload_buf[0..avail_len].copy_from_slice(__input);
6446 Bytes::new(&payload_buf)
6447 } else {
6448 Bytes::new(__input)
6449 };
6450 let mut __struct = Self::default();
6451 __struct.seq = buf.get_u8();
6452 Ok(__struct)
6453 }
6454 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6455 let mut __tmp = BytesMut::new(bytes);
6456 #[allow(clippy::absurd_extreme_comparisons)]
6457 #[allow(unused_comparisons)]
6458 if __tmp.remaining() < Self::ENCODED_LEN {
6459 panic!(
6460 "buffer is too small (need {} bytes, but got {})",
6461 Self::ENCODED_LEN,
6462 __tmp.remaining(),
6463 )
6464 }
6465 __tmp.put_u8(self.seq);
6466 if matches!(version, MavlinkVersion::V2) {
6467 let len = __tmp.len();
6468 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6469 } else {
6470 __tmp.len()
6471 }
6472 }
6473}
6474#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6475#[doc = ""]
6476#[doc = "ID: 372"]
6477#[derive(Debug, Clone, PartialEq)]
6478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6480#[cfg_attr(feature = "ts", derive(TS))]
6481#[cfg_attr(feature = "ts", ts(export))]
6482pub struct BATTERY_INFO_DATA {
6483 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6484 pub discharge_minimum_voltage: f32,
6485 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6486 pub charging_minimum_voltage: f32,
6487 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6488 pub resting_minimum_voltage: f32,
6489 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6490 pub charging_maximum_voltage: f32,
6491 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6492 pub charging_maximum_current: f32,
6493 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6494 pub nominal_voltage: f32,
6495 #[doc = "Maximum pack discharge current. 0: field not provided."]
6496 pub discharge_maximum_current: f32,
6497 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6498 pub discharge_maximum_burst_current: f32,
6499 #[doc = "Fully charged design capacity. 0: field not provided."]
6500 pub design_capacity: f32,
6501 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6502 pub full_charge_capacity: f32,
6503 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6504 pub cycle_count: u16,
6505 #[doc = "Battery weight. 0: field not provided."]
6506 pub weight: u16,
6507 #[doc = "Battery ID"]
6508 pub id: u8,
6509 #[doc = "Function of the battery."]
6510 pub battery_function: MavBatteryFunction,
6511 #[doc = "Type (chemistry) of the battery."]
6512 pub mavtype: MavBatteryType,
6513 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6514 pub state_of_health: u8,
6515 #[doc = "Number of battery cells in series. 0: field not provided."]
6516 pub cells_in_series: u8,
6517 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6518 #[cfg_attr(
6519 feature = "serde",
6520 serde(
6521 serialize_with = "crate::nulstr::serialize::<_, 9>",
6522 deserialize_with = "crate::nulstr::deserialize::<_, 9>"
6523 )
6524 )]
6525 #[cfg_attr(feature = "ts", ts(type = "string"))]
6526 pub manufacture_date: [u8; 9],
6527 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6528 #[cfg_attr(
6529 feature = "serde",
6530 serde(
6531 serialize_with = "crate::nulstr::serialize::<_, 32>",
6532 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
6533 )
6534 )]
6535 #[cfg_attr(feature = "ts", ts(type = "string"))]
6536 pub serial_number: [u8; 32],
6537 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6538 #[cfg_attr(
6539 feature = "serde",
6540 serde(
6541 serialize_with = "crate::nulstr::serialize::<_, 50>",
6542 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
6543 )
6544 )]
6545 #[cfg_attr(feature = "ts", ts(type = "string"))]
6546 pub name: [u8; 50],
6547}
6548impl BATTERY_INFO_DATA {
6549 pub const ENCODED_LEN: usize = 140usize;
6550 pub const DEFAULT: Self = Self {
6551 discharge_minimum_voltage: 0.0_f32,
6552 charging_minimum_voltage: 0.0_f32,
6553 resting_minimum_voltage: 0.0_f32,
6554 charging_maximum_voltage: 0.0_f32,
6555 charging_maximum_current: 0.0_f32,
6556 nominal_voltage: 0.0_f32,
6557 discharge_maximum_current: 0.0_f32,
6558 discharge_maximum_burst_current: 0.0_f32,
6559 design_capacity: 0.0_f32,
6560 full_charge_capacity: 0.0_f32,
6561 cycle_count: 0_u16,
6562 weight: 0_u16,
6563 id: 0_u8,
6564 battery_function: MavBatteryFunction::DEFAULT,
6565 mavtype: MavBatteryType::DEFAULT,
6566 state_of_health: 0_u8,
6567 cells_in_series: 0_u8,
6568 manufacture_date: [0_u8; 9usize],
6569 serial_number: [0_u8; 32usize],
6570 name: [0_u8; 50usize],
6571 };
6572 #[cfg(feature = "arbitrary")]
6573 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6574 use arbitrary::{Arbitrary, Unstructured};
6575 let mut buf = [0u8; 1024];
6576 rng.fill_bytes(&mut buf);
6577 let mut unstructured = Unstructured::new(&buf);
6578 Self::arbitrary(&mut unstructured).unwrap_or_default()
6579 }
6580}
6581impl Default for BATTERY_INFO_DATA {
6582 fn default() -> Self {
6583 Self::DEFAULT.clone()
6584 }
6585}
6586impl MessageData for BATTERY_INFO_DATA {
6587 type Message = MavMessage;
6588 const ID: u32 = 372u32;
6589 const NAME: &'static str = "BATTERY_INFO";
6590 const EXTRA_CRC: u8 = 26u8;
6591 const ENCODED_LEN: usize = 140usize;
6592 fn deser(
6593 _version: MavlinkVersion,
6594 __input: &[u8],
6595 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6596 let avail_len = __input.len();
6597 let mut payload_buf = [0; Self::ENCODED_LEN];
6598 let mut buf = if avail_len < Self::ENCODED_LEN {
6599 payload_buf[0..avail_len].copy_from_slice(__input);
6600 Bytes::new(&payload_buf)
6601 } else {
6602 Bytes::new(__input)
6603 };
6604 let mut __struct = Self::default();
6605 __struct.discharge_minimum_voltage = buf.get_f32_le();
6606 __struct.charging_minimum_voltage = buf.get_f32_le();
6607 __struct.resting_minimum_voltage = buf.get_f32_le();
6608 __struct.charging_maximum_voltage = buf.get_f32_le();
6609 __struct.charging_maximum_current = buf.get_f32_le();
6610 __struct.nominal_voltage = buf.get_f32_le();
6611 __struct.discharge_maximum_current = buf.get_f32_le();
6612 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6613 __struct.design_capacity = buf.get_f32_le();
6614 __struct.full_charge_capacity = buf.get_f32_le();
6615 __struct.cycle_count = buf.get_u16_le();
6616 __struct.weight = buf.get_u16_le();
6617 __struct.id = buf.get_u8();
6618 let tmp = buf.get_u8();
6619 __struct.battery_function =
6620 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6621 enum_type: "MavBatteryFunction",
6622 value: tmp as u32,
6623 })?;
6624 let tmp = buf.get_u8();
6625 __struct.mavtype =
6626 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6627 enum_type: "MavBatteryType",
6628 value: tmp as u32,
6629 })?;
6630 __struct.state_of_health = buf.get_u8();
6631 __struct.cells_in_series = buf.get_u8();
6632 for v in &mut __struct.manufacture_date {
6633 let val = buf.get_u8();
6634 *v = val;
6635 }
6636 for v in &mut __struct.serial_number {
6637 let val = buf.get_u8();
6638 *v = val;
6639 }
6640 for v in &mut __struct.name {
6641 let val = buf.get_u8();
6642 *v = val;
6643 }
6644 Ok(__struct)
6645 }
6646 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6647 let mut __tmp = BytesMut::new(bytes);
6648 #[allow(clippy::absurd_extreme_comparisons)]
6649 #[allow(unused_comparisons)]
6650 if __tmp.remaining() < Self::ENCODED_LEN {
6651 panic!(
6652 "buffer is too small (need {} bytes, but got {})",
6653 Self::ENCODED_LEN,
6654 __tmp.remaining(),
6655 )
6656 }
6657 __tmp.put_f32_le(self.discharge_minimum_voltage);
6658 __tmp.put_f32_le(self.charging_minimum_voltage);
6659 __tmp.put_f32_le(self.resting_minimum_voltage);
6660 __tmp.put_f32_le(self.charging_maximum_voltage);
6661 __tmp.put_f32_le(self.charging_maximum_current);
6662 __tmp.put_f32_le(self.nominal_voltage);
6663 __tmp.put_f32_le(self.discharge_maximum_current);
6664 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6665 __tmp.put_f32_le(self.design_capacity);
6666 __tmp.put_f32_le(self.full_charge_capacity);
6667 __tmp.put_u16_le(self.cycle_count);
6668 __tmp.put_u16_le(self.weight);
6669 __tmp.put_u8(self.id);
6670 __tmp.put_u8(self.battery_function as u8);
6671 __tmp.put_u8(self.mavtype as u8);
6672 __tmp.put_u8(self.state_of_health);
6673 __tmp.put_u8(self.cells_in_series);
6674 for val in &self.manufacture_date {
6675 __tmp.put_u8(*val);
6676 }
6677 for val in &self.serial_number {
6678 __tmp.put_u8(*val);
6679 }
6680 for val in &self.name {
6681 __tmp.put_u8(*val);
6682 }
6683 if matches!(version, MavlinkVersion::V2) {
6684 let len = __tmp.len();
6685 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6686 } else {
6687 __tmp.len()
6688 }
6689 }
6690}
6691#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6692#[doc = ""]
6693#[doc = "ID: 147"]
6694#[derive(Debug, Clone, PartialEq)]
6695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6696#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6697#[cfg_attr(feature = "ts", derive(TS))]
6698#[cfg_attr(feature = "ts", ts(export))]
6699pub struct BATTERY_STATUS_DATA {
6700 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6701 pub current_consumed: i32,
6702 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6703 pub energy_consumed: i32,
6704 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6705 pub temperature: i16,
6706 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6707 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6708 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6709 pub voltages: [u16; 10],
6710 #[doc = "Battery current, -1: autopilot does not measure the current"]
6711 pub current_battery: i16,
6712 #[doc = "Battery ID"]
6713 pub id: u8,
6714 #[doc = "Function of the battery"]
6715 pub battery_function: MavBatteryFunction,
6716 #[doc = "Type (chemistry) of the battery"]
6717 pub mavtype: MavBatteryType,
6718 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6719 pub battery_remaining: i8,
6720 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6721 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6722 pub time_remaining: i32,
6723 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6724 #[cfg_attr(feature = "serde", serde(default))]
6725 pub charge_state: MavBatteryChargeState,
6726 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6727 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6728 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6729 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6730 pub voltages_ext: [u16; 4],
6731 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6732 #[cfg_attr(feature = "serde", serde(default))]
6733 pub mode: MavBatteryMode,
6734 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6735 #[cfg_attr(feature = "serde", serde(default))]
6736 pub fault_bitmask: MavBatteryFault,
6737}
6738impl BATTERY_STATUS_DATA {
6739 pub const ENCODED_LEN: usize = 54usize;
6740 pub const DEFAULT: Self = Self {
6741 current_consumed: 0_i32,
6742 energy_consumed: 0_i32,
6743 temperature: 0_i16,
6744 voltages: [0_u16; 10usize],
6745 current_battery: 0_i16,
6746 id: 0_u8,
6747 battery_function: MavBatteryFunction::DEFAULT,
6748 mavtype: MavBatteryType::DEFAULT,
6749 battery_remaining: 0_i8,
6750 time_remaining: 0_i32,
6751 charge_state: MavBatteryChargeState::DEFAULT,
6752 voltages_ext: [0_u16; 4usize],
6753 mode: MavBatteryMode::DEFAULT,
6754 fault_bitmask: MavBatteryFault::DEFAULT,
6755 };
6756 #[cfg(feature = "arbitrary")]
6757 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6758 use arbitrary::{Arbitrary, Unstructured};
6759 let mut buf = [0u8; 1024];
6760 rng.fill_bytes(&mut buf);
6761 let mut unstructured = Unstructured::new(&buf);
6762 Self::arbitrary(&mut unstructured).unwrap_or_default()
6763 }
6764}
6765impl Default for BATTERY_STATUS_DATA {
6766 fn default() -> Self {
6767 Self::DEFAULT.clone()
6768 }
6769}
6770impl MessageData for BATTERY_STATUS_DATA {
6771 type Message = MavMessage;
6772 const ID: u32 = 147u32;
6773 const NAME: &'static str = "BATTERY_STATUS";
6774 const EXTRA_CRC: u8 = 154u8;
6775 const ENCODED_LEN: usize = 54usize;
6776 fn deser(
6777 _version: MavlinkVersion,
6778 __input: &[u8],
6779 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6780 let avail_len = __input.len();
6781 let mut payload_buf = [0; Self::ENCODED_LEN];
6782 let mut buf = if avail_len < Self::ENCODED_LEN {
6783 payload_buf[0..avail_len].copy_from_slice(__input);
6784 Bytes::new(&payload_buf)
6785 } else {
6786 Bytes::new(__input)
6787 };
6788 let mut __struct = Self::default();
6789 __struct.current_consumed = buf.get_i32_le();
6790 __struct.energy_consumed = buf.get_i32_le();
6791 __struct.temperature = buf.get_i16_le();
6792 for v in &mut __struct.voltages {
6793 let val = buf.get_u16_le();
6794 *v = val;
6795 }
6796 __struct.current_battery = buf.get_i16_le();
6797 __struct.id = buf.get_u8();
6798 let tmp = buf.get_u8();
6799 __struct.battery_function =
6800 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6801 enum_type: "MavBatteryFunction",
6802 value: tmp as u32,
6803 })?;
6804 let tmp = buf.get_u8();
6805 __struct.mavtype =
6806 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6807 enum_type: "MavBatteryType",
6808 value: tmp as u32,
6809 })?;
6810 __struct.battery_remaining = buf.get_i8();
6811 __struct.time_remaining = buf.get_i32_le();
6812 let tmp = buf.get_u8();
6813 __struct.charge_state =
6814 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6815 enum_type: "MavBatteryChargeState",
6816 value: tmp as u32,
6817 })?;
6818 for v in &mut __struct.voltages_ext {
6819 let val = buf.get_u16_le();
6820 *v = val;
6821 }
6822 let tmp = buf.get_u8();
6823 __struct.mode =
6824 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6825 enum_type: "MavBatteryMode",
6826 value: tmp as u32,
6827 })?;
6828 let tmp = buf.get_u32_le();
6829 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6830 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6831 flag_type: "MavBatteryFault",
6832 value: tmp as u32,
6833 })?;
6834 Ok(__struct)
6835 }
6836 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6837 let mut __tmp = BytesMut::new(bytes);
6838 #[allow(clippy::absurd_extreme_comparisons)]
6839 #[allow(unused_comparisons)]
6840 if __tmp.remaining() < Self::ENCODED_LEN {
6841 panic!(
6842 "buffer is too small (need {} bytes, but got {})",
6843 Self::ENCODED_LEN,
6844 __tmp.remaining(),
6845 )
6846 }
6847 __tmp.put_i32_le(self.current_consumed);
6848 __tmp.put_i32_le(self.energy_consumed);
6849 __tmp.put_i16_le(self.temperature);
6850 for val in &self.voltages {
6851 __tmp.put_u16_le(*val);
6852 }
6853 __tmp.put_i16_le(self.current_battery);
6854 __tmp.put_u8(self.id);
6855 __tmp.put_u8(self.battery_function as u8);
6856 __tmp.put_u8(self.mavtype as u8);
6857 __tmp.put_i8(self.battery_remaining);
6858 if matches!(version, MavlinkVersion::V2) {
6859 __tmp.put_i32_le(self.time_remaining);
6860 __tmp.put_u8(self.charge_state as u8);
6861 for val in &self.voltages_ext {
6862 __tmp.put_u16_le(*val);
6863 }
6864 __tmp.put_u8(self.mode as u8);
6865 __tmp.put_u32_le(self.fault_bitmask.bits());
6866 let len = __tmp.len();
6867 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6868 } else {
6869 __tmp.len()
6870 }
6871 }
6872}
6873#[doc = "Report button state change."]
6874#[doc = ""]
6875#[doc = "ID: 257"]
6876#[derive(Debug, Clone, PartialEq)]
6877#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6879#[cfg_attr(feature = "ts", derive(TS))]
6880#[cfg_attr(feature = "ts", ts(export))]
6881pub struct BUTTON_CHANGE_DATA {
6882 #[doc = "Timestamp (time since system boot)."]
6883 pub time_boot_ms: u32,
6884 #[doc = "Time of last change of button state."]
6885 pub last_change_ms: u32,
6886 #[doc = "Bitmap for state of buttons."]
6887 pub state: u8,
6888}
6889impl BUTTON_CHANGE_DATA {
6890 pub const ENCODED_LEN: usize = 9usize;
6891 pub const DEFAULT: Self = Self {
6892 time_boot_ms: 0_u32,
6893 last_change_ms: 0_u32,
6894 state: 0_u8,
6895 };
6896 #[cfg(feature = "arbitrary")]
6897 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6898 use arbitrary::{Arbitrary, Unstructured};
6899 let mut buf = [0u8; 1024];
6900 rng.fill_bytes(&mut buf);
6901 let mut unstructured = Unstructured::new(&buf);
6902 Self::arbitrary(&mut unstructured).unwrap_or_default()
6903 }
6904}
6905impl Default for BUTTON_CHANGE_DATA {
6906 fn default() -> Self {
6907 Self::DEFAULT.clone()
6908 }
6909}
6910impl MessageData for BUTTON_CHANGE_DATA {
6911 type Message = MavMessage;
6912 const ID: u32 = 257u32;
6913 const NAME: &'static str = "BUTTON_CHANGE";
6914 const EXTRA_CRC: u8 = 131u8;
6915 const ENCODED_LEN: usize = 9usize;
6916 fn deser(
6917 _version: MavlinkVersion,
6918 __input: &[u8],
6919 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6920 let avail_len = __input.len();
6921 let mut payload_buf = [0; Self::ENCODED_LEN];
6922 let mut buf = if avail_len < Self::ENCODED_LEN {
6923 payload_buf[0..avail_len].copy_from_slice(__input);
6924 Bytes::new(&payload_buf)
6925 } else {
6926 Bytes::new(__input)
6927 };
6928 let mut __struct = Self::default();
6929 __struct.time_boot_ms = buf.get_u32_le();
6930 __struct.last_change_ms = buf.get_u32_le();
6931 __struct.state = buf.get_u8();
6932 Ok(__struct)
6933 }
6934 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6935 let mut __tmp = BytesMut::new(bytes);
6936 #[allow(clippy::absurd_extreme_comparisons)]
6937 #[allow(unused_comparisons)]
6938 if __tmp.remaining() < Self::ENCODED_LEN {
6939 panic!(
6940 "buffer is too small (need {} bytes, but got {})",
6941 Self::ENCODED_LEN,
6942 __tmp.remaining(),
6943 )
6944 }
6945 __tmp.put_u32_le(self.time_boot_ms);
6946 __tmp.put_u32_le(self.last_change_ms);
6947 __tmp.put_u8(self.state);
6948 if matches!(version, MavlinkVersion::V2) {
6949 let len = __tmp.len();
6950 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6951 } else {
6952 __tmp.len()
6953 }
6954 }
6955}
6956#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6957#[doc = ""]
6958#[doc = "ID: 262"]
6959#[derive(Debug, Clone, PartialEq)]
6960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6962#[cfg_attr(feature = "ts", derive(TS))]
6963#[cfg_attr(feature = "ts", ts(export))]
6964pub struct CAMERA_CAPTURE_STATUS_DATA {
6965 #[doc = "Timestamp (time since system boot)."]
6966 pub time_boot_ms: u32,
6967 #[doc = "Image capture interval"]
6968 pub image_interval: f32,
6969 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6970 pub recording_time_ms: u32,
6971 #[doc = "Available storage capacity."]
6972 pub available_capacity: f32,
6973 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6974 pub image_status: u8,
6975 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6976 pub video_status: u8,
6977 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6978 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6979 pub image_count: i32,
6980 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6981 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6982 pub camera_device_id: u8,
6983}
6984impl CAMERA_CAPTURE_STATUS_DATA {
6985 pub const ENCODED_LEN: usize = 23usize;
6986 pub const DEFAULT: Self = Self {
6987 time_boot_ms: 0_u32,
6988 image_interval: 0.0_f32,
6989 recording_time_ms: 0_u32,
6990 available_capacity: 0.0_f32,
6991 image_status: 0_u8,
6992 video_status: 0_u8,
6993 image_count: 0_i32,
6994 camera_device_id: 0_u8,
6995 };
6996 #[cfg(feature = "arbitrary")]
6997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6998 use arbitrary::{Arbitrary, Unstructured};
6999 let mut buf = [0u8; 1024];
7000 rng.fill_bytes(&mut buf);
7001 let mut unstructured = Unstructured::new(&buf);
7002 Self::arbitrary(&mut unstructured).unwrap_or_default()
7003 }
7004}
7005impl Default for CAMERA_CAPTURE_STATUS_DATA {
7006 fn default() -> Self {
7007 Self::DEFAULT.clone()
7008 }
7009}
7010impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7011 type Message = MavMessage;
7012 const ID: u32 = 262u32;
7013 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7014 const EXTRA_CRC: u8 = 12u8;
7015 const ENCODED_LEN: usize = 23usize;
7016 fn deser(
7017 _version: MavlinkVersion,
7018 __input: &[u8],
7019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7020 let avail_len = __input.len();
7021 let mut payload_buf = [0; Self::ENCODED_LEN];
7022 let mut buf = if avail_len < Self::ENCODED_LEN {
7023 payload_buf[0..avail_len].copy_from_slice(__input);
7024 Bytes::new(&payload_buf)
7025 } else {
7026 Bytes::new(__input)
7027 };
7028 let mut __struct = Self::default();
7029 __struct.time_boot_ms = buf.get_u32_le();
7030 __struct.image_interval = buf.get_f32_le();
7031 __struct.recording_time_ms = buf.get_u32_le();
7032 __struct.available_capacity = buf.get_f32_le();
7033 __struct.image_status = buf.get_u8();
7034 __struct.video_status = buf.get_u8();
7035 __struct.image_count = buf.get_i32_le();
7036 __struct.camera_device_id = buf.get_u8();
7037 Ok(__struct)
7038 }
7039 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7040 let mut __tmp = BytesMut::new(bytes);
7041 #[allow(clippy::absurd_extreme_comparisons)]
7042 #[allow(unused_comparisons)]
7043 if __tmp.remaining() < Self::ENCODED_LEN {
7044 panic!(
7045 "buffer is too small (need {} bytes, but got {})",
7046 Self::ENCODED_LEN,
7047 __tmp.remaining(),
7048 )
7049 }
7050 __tmp.put_u32_le(self.time_boot_ms);
7051 __tmp.put_f32_le(self.image_interval);
7052 __tmp.put_u32_le(self.recording_time_ms);
7053 __tmp.put_f32_le(self.available_capacity);
7054 __tmp.put_u8(self.image_status);
7055 __tmp.put_u8(self.video_status);
7056 if matches!(version, MavlinkVersion::V2) {
7057 __tmp.put_i32_le(self.image_count);
7058 __tmp.put_u8(self.camera_device_id);
7059 let len = __tmp.len();
7060 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7061 } else {
7062 __tmp.len()
7063 }
7064 }
7065}
7066#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7067#[doc = ""]
7068#[doc = "ID: 271"]
7069#[derive(Debug, Clone, PartialEq)]
7070#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7071#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7072#[cfg_attr(feature = "ts", derive(TS))]
7073#[cfg_attr(feature = "ts", ts(export))]
7074pub struct CAMERA_FOV_STATUS_DATA {
7075 #[doc = "Timestamp (time since system boot)."]
7076 pub time_boot_ms: u32,
7077 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7078 pub lat_camera: i32,
7079 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7080 pub lon_camera: i32,
7081 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7082 pub alt_camera: i32,
7083 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7084 pub lat_image: i32,
7085 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7086 pub lon_image: i32,
7087 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7088 pub alt_image: i32,
7089 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7090 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7091 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7092 pub q: [f32; 4],
7093 #[doc = "Horizontal field of view (NaN if unknown)."]
7094 pub hfov: f32,
7095 #[doc = "Vertical field of view (NaN if unknown)."]
7096 pub vfov: f32,
7097 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7098 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7099 pub camera_device_id: u8,
7100}
7101impl CAMERA_FOV_STATUS_DATA {
7102 pub const ENCODED_LEN: usize = 53usize;
7103 pub const DEFAULT: Self = Self {
7104 time_boot_ms: 0_u32,
7105 lat_camera: 0_i32,
7106 lon_camera: 0_i32,
7107 alt_camera: 0_i32,
7108 lat_image: 0_i32,
7109 lon_image: 0_i32,
7110 alt_image: 0_i32,
7111 q: [0.0_f32; 4usize],
7112 hfov: 0.0_f32,
7113 vfov: 0.0_f32,
7114 camera_device_id: 0_u8,
7115 };
7116 #[cfg(feature = "arbitrary")]
7117 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7118 use arbitrary::{Arbitrary, Unstructured};
7119 let mut buf = [0u8; 1024];
7120 rng.fill_bytes(&mut buf);
7121 let mut unstructured = Unstructured::new(&buf);
7122 Self::arbitrary(&mut unstructured).unwrap_or_default()
7123 }
7124}
7125impl Default for CAMERA_FOV_STATUS_DATA {
7126 fn default() -> Self {
7127 Self::DEFAULT.clone()
7128 }
7129}
7130impl MessageData for CAMERA_FOV_STATUS_DATA {
7131 type Message = MavMessage;
7132 const ID: u32 = 271u32;
7133 const NAME: &'static str = "CAMERA_FOV_STATUS";
7134 const EXTRA_CRC: u8 = 22u8;
7135 const ENCODED_LEN: usize = 53usize;
7136 fn deser(
7137 _version: MavlinkVersion,
7138 __input: &[u8],
7139 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7140 let avail_len = __input.len();
7141 let mut payload_buf = [0; Self::ENCODED_LEN];
7142 let mut buf = if avail_len < Self::ENCODED_LEN {
7143 payload_buf[0..avail_len].copy_from_slice(__input);
7144 Bytes::new(&payload_buf)
7145 } else {
7146 Bytes::new(__input)
7147 };
7148 let mut __struct = Self::default();
7149 __struct.time_boot_ms = buf.get_u32_le();
7150 __struct.lat_camera = buf.get_i32_le();
7151 __struct.lon_camera = buf.get_i32_le();
7152 __struct.alt_camera = buf.get_i32_le();
7153 __struct.lat_image = buf.get_i32_le();
7154 __struct.lon_image = buf.get_i32_le();
7155 __struct.alt_image = buf.get_i32_le();
7156 for v in &mut __struct.q {
7157 let val = buf.get_f32_le();
7158 *v = val;
7159 }
7160 __struct.hfov = buf.get_f32_le();
7161 __struct.vfov = buf.get_f32_le();
7162 __struct.camera_device_id = buf.get_u8();
7163 Ok(__struct)
7164 }
7165 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7166 let mut __tmp = BytesMut::new(bytes);
7167 #[allow(clippy::absurd_extreme_comparisons)]
7168 #[allow(unused_comparisons)]
7169 if __tmp.remaining() < Self::ENCODED_LEN {
7170 panic!(
7171 "buffer is too small (need {} bytes, but got {})",
7172 Self::ENCODED_LEN,
7173 __tmp.remaining(),
7174 )
7175 }
7176 __tmp.put_u32_le(self.time_boot_ms);
7177 __tmp.put_i32_le(self.lat_camera);
7178 __tmp.put_i32_le(self.lon_camera);
7179 __tmp.put_i32_le(self.alt_camera);
7180 __tmp.put_i32_le(self.lat_image);
7181 __tmp.put_i32_le(self.lon_image);
7182 __tmp.put_i32_le(self.alt_image);
7183 for val in &self.q {
7184 __tmp.put_f32_le(*val);
7185 }
7186 __tmp.put_f32_le(self.hfov);
7187 __tmp.put_f32_le(self.vfov);
7188 if matches!(version, MavlinkVersion::V2) {
7189 __tmp.put_u8(self.camera_device_id);
7190 let len = __tmp.len();
7191 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7192 } else {
7193 __tmp.len()
7194 }
7195 }
7196}
7197#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7198#[doc = ""]
7199#[doc = "ID: 263"]
7200#[derive(Debug, Clone, PartialEq)]
7201#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7202#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7203#[cfg_attr(feature = "ts", derive(TS))]
7204#[cfg_attr(feature = "ts", ts(export))]
7205pub struct CAMERA_IMAGE_CAPTURED_DATA {
7206 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7207 pub time_utc: u64,
7208 #[doc = "Timestamp (time since system boot)."]
7209 pub time_boot_ms: u32,
7210 #[doc = "Latitude where image was taken"]
7211 pub lat: i32,
7212 #[doc = "Longitude where capture was taken"]
7213 pub lon: i32,
7214 #[doc = "Altitude (MSL) where image was taken"]
7215 pub alt: i32,
7216 #[doc = "Altitude above ground"]
7217 pub relative_alt: i32,
7218 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7219 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7220 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7221 pub q: [f32; 4],
7222 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7223 pub image_index: i32,
7224 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7225 pub camera_id: u8,
7226 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7227 pub capture_result: i8,
7228 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7229 #[cfg_attr(
7230 feature = "serde",
7231 serde(
7232 serialize_with = "crate::nulstr::serialize::<_, 205>",
7233 deserialize_with = "crate::nulstr::deserialize::<_, 205>"
7234 )
7235 )]
7236 #[cfg_attr(feature = "ts", ts(type = "string"))]
7237 pub file_url: [u8; 205],
7238}
7239impl CAMERA_IMAGE_CAPTURED_DATA {
7240 pub const ENCODED_LEN: usize = 255usize;
7241 pub const DEFAULT: Self = Self {
7242 time_utc: 0_u64,
7243 time_boot_ms: 0_u32,
7244 lat: 0_i32,
7245 lon: 0_i32,
7246 alt: 0_i32,
7247 relative_alt: 0_i32,
7248 q: [0.0_f32; 4usize],
7249 image_index: 0_i32,
7250 camera_id: 0_u8,
7251 capture_result: 0_i8,
7252 file_url: [0_u8; 205usize],
7253 };
7254 #[cfg(feature = "arbitrary")]
7255 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7256 use arbitrary::{Arbitrary, Unstructured};
7257 let mut buf = [0u8; 1024];
7258 rng.fill_bytes(&mut buf);
7259 let mut unstructured = Unstructured::new(&buf);
7260 Self::arbitrary(&mut unstructured).unwrap_or_default()
7261 }
7262}
7263impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7264 fn default() -> Self {
7265 Self::DEFAULT.clone()
7266 }
7267}
7268impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7269 type Message = MavMessage;
7270 const ID: u32 = 263u32;
7271 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7272 const EXTRA_CRC: u8 = 133u8;
7273 const ENCODED_LEN: usize = 255usize;
7274 fn deser(
7275 _version: MavlinkVersion,
7276 __input: &[u8],
7277 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7278 let avail_len = __input.len();
7279 let mut payload_buf = [0; Self::ENCODED_LEN];
7280 let mut buf = if avail_len < Self::ENCODED_LEN {
7281 payload_buf[0..avail_len].copy_from_slice(__input);
7282 Bytes::new(&payload_buf)
7283 } else {
7284 Bytes::new(__input)
7285 };
7286 let mut __struct = Self::default();
7287 __struct.time_utc = buf.get_u64_le();
7288 __struct.time_boot_ms = buf.get_u32_le();
7289 __struct.lat = buf.get_i32_le();
7290 __struct.lon = buf.get_i32_le();
7291 __struct.alt = buf.get_i32_le();
7292 __struct.relative_alt = buf.get_i32_le();
7293 for v in &mut __struct.q {
7294 let val = buf.get_f32_le();
7295 *v = val;
7296 }
7297 __struct.image_index = buf.get_i32_le();
7298 __struct.camera_id = buf.get_u8();
7299 __struct.capture_result = buf.get_i8();
7300 for v in &mut __struct.file_url {
7301 let val = buf.get_u8();
7302 *v = val;
7303 }
7304 Ok(__struct)
7305 }
7306 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7307 let mut __tmp = BytesMut::new(bytes);
7308 #[allow(clippy::absurd_extreme_comparisons)]
7309 #[allow(unused_comparisons)]
7310 if __tmp.remaining() < Self::ENCODED_LEN {
7311 panic!(
7312 "buffer is too small (need {} bytes, but got {})",
7313 Self::ENCODED_LEN,
7314 __tmp.remaining(),
7315 )
7316 }
7317 __tmp.put_u64_le(self.time_utc);
7318 __tmp.put_u32_le(self.time_boot_ms);
7319 __tmp.put_i32_le(self.lat);
7320 __tmp.put_i32_le(self.lon);
7321 __tmp.put_i32_le(self.alt);
7322 __tmp.put_i32_le(self.relative_alt);
7323 for val in &self.q {
7324 __tmp.put_f32_le(*val);
7325 }
7326 __tmp.put_i32_le(self.image_index);
7327 __tmp.put_u8(self.camera_id);
7328 __tmp.put_i8(self.capture_result);
7329 for val in &self.file_url {
7330 __tmp.put_u8(*val);
7331 }
7332 if matches!(version, MavlinkVersion::V2) {
7333 let len = __tmp.len();
7334 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7335 } else {
7336 __tmp.len()
7337 }
7338 }
7339}
7340#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7341#[doc = ""]
7342#[doc = "ID: 259"]
7343#[derive(Debug, Clone, PartialEq)]
7344#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7346#[cfg_attr(feature = "ts", derive(TS))]
7347#[cfg_attr(feature = "ts", ts(export))]
7348pub struct CAMERA_INFORMATION_DATA {
7349 #[doc = "Timestamp (time since system boot)."]
7350 pub time_boot_ms: u32,
7351 #[doc = "0xff). Use 0 if not known."]
7352 pub firmware_version: u32,
7353 #[doc = "Focal length. Use NaN if not known."]
7354 pub focal_length: f32,
7355 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7356 pub sensor_size_h: f32,
7357 #[doc = "Image sensor size vertical. Use NaN if not known."]
7358 pub sensor_size_v: f32,
7359 #[doc = "Bitmap of camera capability flags."]
7360 pub flags: CameraCapFlags,
7361 #[doc = "Horizontal image resolution. Use 0 if not known."]
7362 pub resolution_h: u16,
7363 #[doc = "Vertical image resolution. Use 0 if not known."]
7364 pub resolution_v: u16,
7365 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7366 pub cam_definition_version: u16,
7367 #[doc = "Name of the camera vendor"]
7368 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7369 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7370 pub vendor_name: [u8; 32],
7371 #[doc = "Name of the camera model"]
7372 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7373 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7374 pub model_name: [u8; 32],
7375 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7376 pub lens_id: u8,
7377 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7378 #[cfg_attr(
7379 feature = "serde",
7380 serde(
7381 serialize_with = "crate::nulstr::serialize::<_, 140>",
7382 deserialize_with = "crate::nulstr::deserialize::<_, 140>"
7383 )
7384 )]
7385 #[cfg_attr(feature = "ts", ts(type = "string"))]
7386 pub cam_definition_uri: [u8; 140],
7387 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7388 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7389 pub gimbal_device_id: u8,
7390 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7391 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7392 pub camera_device_id: u8,
7393}
7394impl CAMERA_INFORMATION_DATA {
7395 pub const ENCODED_LEN: usize = 237usize;
7396 pub const DEFAULT: Self = Self {
7397 time_boot_ms: 0_u32,
7398 firmware_version: 0_u32,
7399 focal_length: 0.0_f32,
7400 sensor_size_h: 0.0_f32,
7401 sensor_size_v: 0.0_f32,
7402 flags: CameraCapFlags::DEFAULT,
7403 resolution_h: 0_u16,
7404 resolution_v: 0_u16,
7405 cam_definition_version: 0_u16,
7406 vendor_name: [0_u8; 32usize],
7407 model_name: [0_u8; 32usize],
7408 lens_id: 0_u8,
7409 cam_definition_uri: [0_u8; 140usize],
7410 gimbal_device_id: 0_u8,
7411 camera_device_id: 0_u8,
7412 };
7413 #[cfg(feature = "arbitrary")]
7414 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7415 use arbitrary::{Arbitrary, Unstructured};
7416 let mut buf = [0u8; 1024];
7417 rng.fill_bytes(&mut buf);
7418 let mut unstructured = Unstructured::new(&buf);
7419 Self::arbitrary(&mut unstructured).unwrap_or_default()
7420 }
7421}
7422impl Default for CAMERA_INFORMATION_DATA {
7423 fn default() -> Self {
7424 Self::DEFAULT.clone()
7425 }
7426}
7427impl MessageData for CAMERA_INFORMATION_DATA {
7428 type Message = MavMessage;
7429 const ID: u32 = 259u32;
7430 const NAME: &'static str = "CAMERA_INFORMATION";
7431 const EXTRA_CRC: u8 = 92u8;
7432 const ENCODED_LEN: usize = 237usize;
7433 fn deser(
7434 _version: MavlinkVersion,
7435 __input: &[u8],
7436 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7437 let avail_len = __input.len();
7438 let mut payload_buf = [0; Self::ENCODED_LEN];
7439 let mut buf = if avail_len < Self::ENCODED_LEN {
7440 payload_buf[0..avail_len].copy_from_slice(__input);
7441 Bytes::new(&payload_buf)
7442 } else {
7443 Bytes::new(__input)
7444 };
7445 let mut __struct = Self::default();
7446 __struct.time_boot_ms = buf.get_u32_le();
7447 __struct.firmware_version = buf.get_u32_le();
7448 __struct.focal_length = buf.get_f32_le();
7449 __struct.sensor_size_h = buf.get_f32_le();
7450 __struct.sensor_size_v = buf.get_f32_le();
7451 let tmp = buf.get_u32_le();
7452 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7453 ::mavlink_core::error::ParserError::InvalidFlag {
7454 flag_type: "CameraCapFlags",
7455 value: tmp as u32,
7456 },
7457 )?;
7458 __struct.resolution_h = buf.get_u16_le();
7459 __struct.resolution_v = buf.get_u16_le();
7460 __struct.cam_definition_version = buf.get_u16_le();
7461 for v in &mut __struct.vendor_name {
7462 let val = buf.get_u8();
7463 *v = val;
7464 }
7465 for v in &mut __struct.model_name {
7466 let val = buf.get_u8();
7467 *v = val;
7468 }
7469 __struct.lens_id = buf.get_u8();
7470 for v in &mut __struct.cam_definition_uri {
7471 let val = buf.get_u8();
7472 *v = val;
7473 }
7474 __struct.gimbal_device_id = buf.get_u8();
7475 __struct.camera_device_id = buf.get_u8();
7476 Ok(__struct)
7477 }
7478 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7479 let mut __tmp = BytesMut::new(bytes);
7480 #[allow(clippy::absurd_extreme_comparisons)]
7481 #[allow(unused_comparisons)]
7482 if __tmp.remaining() < Self::ENCODED_LEN {
7483 panic!(
7484 "buffer is too small (need {} bytes, but got {})",
7485 Self::ENCODED_LEN,
7486 __tmp.remaining(),
7487 )
7488 }
7489 __tmp.put_u32_le(self.time_boot_ms);
7490 __tmp.put_u32_le(self.firmware_version);
7491 __tmp.put_f32_le(self.focal_length);
7492 __tmp.put_f32_le(self.sensor_size_h);
7493 __tmp.put_f32_le(self.sensor_size_v);
7494 __tmp.put_u32_le(self.flags.bits());
7495 __tmp.put_u16_le(self.resolution_h);
7496 __tmp.put_u16_le(self.resolution_v);
7497 __tmp.put_u16_le(self.cam_definition_version);
7498 for val in &self.vendor_name {
7499 __tmp.put_u8(*val);
7500 }
7501 for val in &self.model_name {
7502 __tmp.put_u8(*val);
7503 }
7504 __tmp.put_u8(self.lens_id);
7505 for val in &self.cam_definition_uri {
7506 __tmp.put_u8(*val);
7507 }
7508 if matches!(version, MavlinkVersion::V2) {
7509 __tmp.put_u8(self.gimbal_device_id);
7510 __tmp.put_u8(self.camera_device_id);
7511 let len = __tmp.len();
7512 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7513 } else {
7514 __tmp.len()
7515 }
7516 }
7517}
7518#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7519#[doc = ""]
7520#[doc = "ID: 260"]
7521#[derive(Debug, Clone, PartialEq)]
7522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7523#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7524#[cfg_attr(feature = "ts", derive(TS))]
7525#[cfg_attr(feature = "ts", ts(export))]
7526pub struct CAMERA_SETTINGS_DATA {
7527 #[doc = "Timestamp (time since system boot)."]
7528 pub time_boot_ms: u32,
7529 #[doc = "Camera mode"]
7530 pub mode_id: CameraMode,
7531 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7532 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7533 pub zoomLevel: f32,
7534 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7535 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7536 pub focusLevel: f32,
7537 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7538 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7539 pub camera_device_id: u8,
7540}
7541impl CAMERA_SETTINGS_DATA {
7542 pub const ENCODED_LEN: usize = 14usize;
7543 pub const DEFAULT: Self = Self {
7544 time_boot_ms: 0_u32,
7545 mode_id: CameraMode::DEFAULT,
7546 zoomLevel: 0.0_f32,
7547 focusLevel: 0.0_f32,
7548 camera_device_id: 0_u8,
7549 };
7550 #[cfg(feature = "arbitrary")]
7551 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7552 use arbitrary::{Arbitrary, Unstructured};
7553 let mut buf = [0u8; 1024];
7554 rng.fill_bytes(&mut buf);
7555 let mut unstructured = Unstructured::new(&buf);
7556 Self::arbitrary(&mut unstructured).unwrap_or_default()
7557 }
7558}
7559impl Default for CAMERA_SETTINGS_DATA {
7560 fn default() -> Self {
7561 Self::DEFAULT.clone()
7562 }
7563}
7564impl MessageData for CAMERA_SETTINGS_DATA {
7565 type Message = MavMessage;
7566 const ID: u32 = 260u32;
7567 const NAME: &'static str = "CAMERA_SETTINGS";
7568 const EXTRA_CRC: u8 = 146u8;
7569 const ENCODED_LEN: usize = 14usize;
7570 fn deser(
7571 _version: MavlinkVersion,
7572 __input: &[u8],
7573 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7574 let avail_len = __input.len();
7575 let mut payload_buf = [0; Self::ENCODED_LEN];
7576 let mut buf = if avail_len < Self::ENCODED_LEN {
7577 payload_buf[0..avail_len].copy_from_slice(__input);
7578 Bytes::new(&payload_buf)
7579 } else {
7580 Bytes::new(__input)
7581 };
7582 let mut __struct = Self::default();
7583 __struct.time_boot_ms = buf.get_u32_le();
7584 let tmp = buf.get_u8();
7585 __struct.mode_id =
7586 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7587 enum_type: "CameraMode",
7588 value: tmp as u32,
7589 })?;
7590 __struct.zoomLevel = buf.get_f32_le();
7591 __struct.focusLevel = buf.get_f32_le();
7592 __struct.camera_device_id = buf.get_u8();
7593 Ok(__struct)
7594 }
7595 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7596 let mut __tmp = BytesMut::new(bytes);
7597 #[allow(clippy::absurd_extreme_comparisons)]
7598 #[allow(unused_comparisons)]
7599 if __tmp.remaining() < Self::ENCODED_LEN {
7600 panic!(
7601 "buffer is too small (need {} bytes, but got {})",
7602 Self::ENCODED_LEN,
7603 __tmp.remaining(),
7604 )
7605 }
7606 __tmp.put_u32_le(self.time_boot_ms);
7607 __tmp.put_u8(self.mode_id as u8);
7608 if matches!(version, MavlinkVersion::V2) {
7609 __tmp.put_f32_le(self.zoomLevel);
7610 __tmp.put_f32_le(self.focusLevel);
7611 __tmp.put_u8(self.camera_device_id);
7612 let len = __tmp.len();
7613 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7614 } else {
7615 __tmp.len()
7616 }
7617 }
7618}
7619#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7620#[doc = ""]
7621#[doc = "ID: 277"]
7622#[derive(Debug, Clone, PartialEq)]
7623#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7625#[cfg_attr(feature = "ts", derive(TS))]
7626#[cfg_attr(feature = "ts", ts(export))]
7627pub struct CAMERA_THERMAL_RANGE_DATA {
7628 #[doc = "Timestamp (time since system boot)."]
7629 pub time_boot_ms: u32,
7630 #[doc = "Temperature max."]
7631 pub max: f32,
7632 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7633 pub max_point_x: f32,
7634 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7635 pub max_point_y: f32,
7636 #[doc = "Temperature min."]
7637 pub min: f32,
7638 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7639 pub min_point_x: f32,
7640 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7641 pub min_point_y: f32,
7642 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7643 pub stream_id: u8,
7644 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7645 pub camera_device_id: u8,
7646}
7647impl CAMERA_THERMAL_RANGE_DATA {
7648 pub const ENCODED_LEN: usize = 30usize;
7649 pub const DEFAULT: Self = Self {
7650 time_boot_ms: 0_u32,
7651 max: 0.0_f32,
7652 max_point_x: 0.0_f32,
7653 max_point_y: 0.0_f32,
7654 min: 0.0_f32,
7655 min_point_x: 0.0_f32,
7656 min_point_y: 0.0_f32,
7657 stream_id: 0_u8,
7658 camera_device_id: 0_u8,
7659 };
7660 #[cfg(feature = "arbitrary")]
7661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7662 use arbitrary::{Arbitrary, Unstructured};
7663 let mut buf = [0u8; 1024];
7664 rng.fill_bytes(&mut buf);
7665 let mut unstructured = Unstructured::new(&buf);
7666 Self::arbitrary(&mut unstructured).unwrap_or_default()
7667 }
7668}
7669impl Default for CAMERA_THERMAL_RANGE_DATA {
7670 fn default() -> Self {
7671 Self::DEFAULT.clone()
7672 }
7673}
7674impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7675 type Message = MavMessage;
7676 const ID: u32 = 277u32;
7677 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7678 const EXTRA_CRC: u8 = 62u8;
7679 const ENCODED_LEN: usize = 30usize;
7680 fn deser(
7681 _version: MavlinkVersion,
7682 __input: &[u8],
7683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7684 let avail_len = __input.len();
7685 let mut payload_buf = [0; Self::ENCODED_LEN];
7686 let mut buf = if avail_len < Self::ENCODED_LEN {
7687 payload_buf[0..avail_len].copy_from_slice(__input);
7688 Bytes::new(&payload_buf)
7689 } else {
7690 Bytes::new(__input)
7691 };
7692 let mut __struct = Self::default();
7693 __struct.time_boot_ms = buf.get_u32_le();
7694 __struct.max = buf.get_f32_le();
7695 __struct.max_point_x = buf.get_f32_le();
7696 __struct.max_point_y = buf.get_f32_le();
7697 __struct.min = buf.get_f32_le();
7698 __struct.min_point_x = buf.get_f32_le();
7699 __struct.min_point_y = buf.get_f32_le();
7700 __struct.stream_id = buf.get_u8();
7701 __struct.camera_device_id = buf.get_u8();
7702 Ok(__struct)
7703 }
7704 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7705 let mut __tmp = BytesMut::new(bytes);
7706 #[allow(clippy::absurd_extreme_comparisons)]
7707 #[allow(unused_comparisons)]
7708 if __tmp.remaining() < Self::ENCODED_LEN {
7709 panic!(
7710 "buffer is too small (need {} bytes, but got {})",
7711 Self::ENCODED_LEN,
7712 __tmp.remaining(),
7713 )
7714 }
7715 __tmp.put_u32_le(self.time_boot_ms);
7716 __tmp.put_f32_le(self.max);
7717 __tmp.put_f32_le(self.max_point_x);
7718 __tmp.put_f32_le(self.max_point_y);
7719 __tmp.put_f32_le(self.min);
7720 __tmp.put_f32_le(self.min_point_x);
7721 __tmp.put_f32_le(self.min_point_y);
7722 __tmp.put_u8(self.stream_id);
7723 __tmp.put_u8(self.camera_device_id);
7724 if matches!(version, MavlinkVersion::V2) {
7725 let len = __tmp.len();
7726 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7727 } else {
7728 __tmp.len()
7729 }
7730 }
7731}
7732#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7733#[doc = ""]
7734#[doc = "ID: 276"]
7735#[derive(Debug, Clone, PartialEq)]
7736#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7738#[cfg_attr(feature = "ts", derive(TS))]
7739#[cfg_attr(feature = "ts", ts(export))]
7740pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7741 #[doc = "Latitude of tracked object"]
7742 pub lat: i32,
7743 #[doc = "Longitude of tracked object"]
7744 pub lon: i32,
7745 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7746 pub alt: f32,
7747 #[doc = "Horizontal accuracy. NAN if unknown"]
7748 pub h_acc: f32,
7749 #[doc = "Vertical accuracy. NAN if unknown"]
7750 pub v_acc: f32,
7751 #[doc = "North velocity of tracked object. NAN if unknown"]
7752 pub vel_n: f32,
7753 #[doc = "East velocity of tracked object. NAN if unknown"]
7754 pub vel_e: f32,
7755 #[doc = "Down velocity of tracked object. NAN if unknown"]
7756 pub vel_d: f32,
7757 #[doc = "Velocity accuracy. NAN if unknown"]
7758 pub vel_acc: f32,
7759 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7760 pub dist: f32,
7761 #[doc = "Heading in radians, in NED. NAN if unknown"]
7762 pub hdg: f32,
7763 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7764 pub hdg_acc: f32,
7765 #[doc = "Current tracking status"]
7766 pub tracking_status: CameraTrackingStatusFlags,
7767 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7768 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7769 pub camera_device_id: u8,
7770}
7771impl CAMERA_TRACKING_GEO_STATUS_DATA {
7772 pub const ENCODED_LEN: usize = 50usize;
7773 pub const DEFAULT: Self = Self {
7774 lat: 0_i32,
7775 lon: 0_i32,
7776 alt: 0.0_f32,
7777 h_acc: 0.0_f32,
7778 v_acc: 0.0_f32,
7779 vel_n: 0.0_f32,
7780 vel_e: 0.0_f32,
7781 vel_d: 0.0_f32,
7782 vel_acc: 0.0_f32,
7783 dist: 0.0_f32,
7784 hdg: 0.0_f32,
7785 hdg_acc: 0.0_f32,
7786 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7787 camera_device_id: 0_u8,
7788 };
7789 #[cfg(feature = "arbitrary")]
7790 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7791 use arbitrary::{Arbitrary, Unstructured};
7792 let mut buf = [0u8; 1024];
7793 rng.fill_bytes(&mut buf);
7794 let mut unstructured = Unstructured::new(&buf);
7795 Self::arbitrary(&mut unstructured).unwrap_or_default()
7796 }
7797}
7798impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7799 fn default() -> Self {
7800 Self::DEFAULT.clone()
7801 }
7802}
7803impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7804 type Message = MavMessage;
7805 const ID: u32 = 276u32;
7806 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7807 const EXTRA_CRC: u8 = 18u8;
7808 const ENCODED_LEN: usize = 50usize;
7809 fn deser(
7810 _version: MavlinkVersion,
7811 __input: &[u8],
7812 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7813 let avail_len = __input.len();
7814 let mut payload_buf = [0; Self::ENCODED_LEN];
7815 let mut buf = if avail_len < Self::ENCODED_LEN {
7816 payload_buf[0..avail_len].copy_from_slice(__input);
7817 Bytes::new(&payload_buf)
7818 } else {
7819 Bytes::new(__input)
7820 };
7821 let mut __struct = Self::default();
7822 __struct.lat = buf.get_i32_le();
7823 __struct.lon = buf.get_i32_le();
7824 __struct.alt = buf.get_f32_le();
7825 __struct.h_acc = buf.get_f32_le();
7826 __struct.v_acc = buf.get_f32_le();
7827 __struct.vel_n = buf.get_f32_le();
7828 __struct.vel_e = buf.get_f32_le();
7829 __struct.vel_d = buf.get_f32_le();
7830 __struct.vel_acc = buf.get_f32_le();
7831 __struct.dist = buf.get_f32_le();
7832 __struct.hdg = buf.get_f32_le();
7833 __struct.hdg_acc = buf.get_f32_le();
7834 let tmp = buf.get_u8();
7835 __struct.tracking_status =
7836 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7837 enum_type: "CameraTrackingStatusFlags",
7838 value: tmp as u32,
7839 })?;
7840 __struct.camera_device_id = buf.get_u8();
7841 Ok(__struct)
7842 }
7843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7844 let mut __tmp = BytesMut::new(bytes);
7845 #[allow(clippy::absurd_extreme_comparisons)]
7846 #[allow(unused_comparisons)]
7847 if __tmp.remaining() < Self::ENCODED_LEN {
7848 panic!(
7849 "buffer is too small (need {} bytes, but got {})",
7850 Self::ENCODED_LEN,
7851 __tmp.remaining(),
7852 )
7853 }
7854 __tmp.put_i32_le(self.lat);
7855 __tmp.put_i32_le(self.lon);
7856 __tmp.put_f32_le(self.alt);
7857 __tmp.put_f32_le(self.h_acc);
7858 __tmp.put_f32_le(self.v_acc);
7859 __tmp.put_f32_le(self.vel_n);
7860 __tmp.put_f32_le(self.vel_e);
7861 __tmp.put_f32_le(self.vel_d);
7862 __tmp.put_f32_le(self.vel_acc);
7863 __tmp.put_f32_le(self.dist);
7864 __tmp.put_f32_le(self.hdg);
7865 __tmp.put_f32_le(self.hdg_acc);
7866 __tmp.put_u8(self.tracking_status as u8);
7867 if matches!(version, MavlinkVersion::V2) {
7868 __tmp.put_u8(self.camera_device_id);
7869 let len = __tmp.len();
7870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7871 } else {
7872 __tmp.len()
7873 }
7874 }
7875}
7876#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7877#[doc = ""]
7878#[doc = "ID: 275"]
7879#[derive(Debug, Clone, PartialEq)]
7880#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7881#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7882#[cfg_attr(feature = "ts", derive(TS))]
7883#[cfg_attr(feature = "ts", ts(export))]
7884pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7885 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7886 pub point_x: f32,
7887 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7888 pub point_y: f32,
7889 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7890 pub radius: f32,
7891 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7892 pub rec_top_x: f32,
7893 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7894 pub rec_top_y: f32,
7895 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7896 pub rec_bottom_x: f32,
7897 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7898 pub rec_bottom_y: f32,
7899 #[doc = "Current tracking status"]
7900 pub tracking_status: CameraTrackingStatusFlags,
7901 #[doc = "Current tracking mode"]
7902 pub tracking_mode: CameraTrackingMode,
7903 #[doc = "Defines location of target data"]
7904 pub target_data: CameraTrackingTargetData,
7905 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7906 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7907 pub camera_device_id: u8,
7908}
7909impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7910 pub const ENCODED_LEN: usize = 32usize;
7911 pub const DEFAULT: Self = Self {
7912 point_x: 0.0_f32,
7913 point_y: 0.0_f32,
7914 radius: 0.0_f32,
7915 rec_top_x: 0.0_f32,
7916 rec_top_y: 0.0_f32,
7917 rec_bottom_x: 0.0_f32,
7918 rec_bottom_y: 0.0_f32,
7919 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7920 tracking_mode: CameraTrackingMode::DEFAULT,
7921 target_data: CameraTrackingTargetData::DEFAULT,
7922 camera_device_id: 0_u8,
7923 };
7924 #[cfg(feature = "arbitrary")]
7925 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7926 use arbitrary::{Arbitrary, Unstructured};
7927 let mut buf = [0u8; 1024];
7928 rng.fill_bytes(&mut buf);
7929 let mut unstructured = Unstructured::new(&buf);
7930 Self::arbitrary(&mut unstructured).unwrap_or_default()
7931 }
7932}
7933impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7934 fn default() -> Self {
7935 Self::DEFAULT.clone()
7936 }
7937}
7938impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7939 type Message = MavMessage;
7940 const ID: u32 = 275u32;
7941 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7942 const EXTRA_CRC: u8 = 126u8;
7943 const ENCODED_LEN: usize = 32usize;
7944 fn deser(
7945 _version: MavlinkVersion,
7946 __input: &[u8],
7947 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7948 let avail_len = __input.len();
7949 let mut payload_buf = [0; Self::ENCODED_LEN];
7950 let mut buf = if avail_len < Self::ENCODED_LEN {
7951 payload_buf[0..avail_len].copy_from_slice(__input);
7952 Bytes::new(&payload_buf)
7953 } else {
7954 Bytes::new(__input)
7955 };
7956 let mut __struct = Self::default();
7957 __struct.point_x = buf.get_f32_le();
7958 __struct.point_y = buf.get_f32_le();
7959 __struct.radius = buf.get_f32_le();
7960 __struct.rec_top_x = buf.get_f32_le();
7961 __struct.rec_top_y = buf.get_f32_le();
7962 __struct.rec_bottom_x = buf.get_f32_le();
7963 __struct.rec_bottom_y = buf.get_f32_le();
7964 let tmp = buf.get_u8();
7965 __struct.tracking_status =
7966 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7967 enum_type: "CameraTrackingStatusFlags",
7968 value: tmp as u32,
7969 })?;
7970 let tmp = buf.get_u8();
7971 __struct.tracking_mode =
7972 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7973 enum_type: "CameraTrackingMode",
7974 value: tmp as u32,
7975 })?;
7976 let tmp = buf.get_u8();
7977 __struct.target_data =
7978 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7979 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7980 flag_type: "CameraTrackingTargetData",
7981 value: tmp as u32,
7982 })?;
7983 __struct.camera_device_id = buf.get_u8();
7984 Ok(__struct)
7985 }
7986 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7987 let mut __tmp = BytesMut::new(bytes);
7988 #[allow(clippy::absurd_extreme_comparisons)]
7989 #[allow(unused_comparisons)]
7990 if __tmp.remaining() < Self::ENCODED_LEN {
7991 panic!(
7992 "buffer is too small (need {} bytes, but got {})",
7993 Self::ENCODED_LEN,
7994 __tmp.remaining(),
7995 )
7996 }
7997 __tmp.put_f32_le(self.point_x);
7998 __tmp.put_f32_le(self.point_y);
7999 __tmp.put_f32_le(self.radius);
8000 __tmp.put_f32_le(self.rec_top_x);
8001 __tmp.put_f32_le(self.rec_top_y);
8002 __tmp.put_f32_le(self.rec_bottom_x);
8003 __tmp.put_f32_le(self.rec_bottom_y);
8004 __tmp.put_u8(self.tracking_status as u8);
8005 __tmp.put_u8(self.tracking_mode as u8);
8006 __tmp.put_u8(self.target_data.bits());
8007 if matches!(version, MavlinkVersion::V2) {
8008 __tmp.put_u8(self.camera_device_id);
8009 let len = __tmp.len();
8010 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8011 } else {
8012 __tmp.len()
8013 }
8014 }
8015}
8016#[doc = "Camera-IMU triggering and synchronisation message."]
8017#[doc = ""]
8018#[doc = "ID: 112"]
8019#[derive(Debug, Clone, PartialEq)]
8020#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8021#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8022#[cfg_attr(feature = "ts", derive(TS))]
8023#[cfg_attr(feature = "ts", ts(export))]
8024pub struct CAMERA_TRIGGER_DATA {
8025 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8026 pub time_usec: u64,
8027 #[doc = "Image frame sequence"]
8028 pub seq: u32,
8029}
8030impl CAMERA_TRIGGER_DATA {
8031 pub const ENCODED_LEN: usize = 12usize;
8032 pub const DEFAULT: Self = Self {
8033 time_usec: 0_u64,
8034 seq: 0_u32,
8035 };
8036 #[cfg(feature = "arbitrary")]
8037 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8038 use arbitrary::{Arbitrary, Unstructured};
8039 let mut buf = [0u8; 1024];
8040 rng.fill_bytes(&mut buf);
8041 let mut unstructured = Unstructured::new(&buf);
8042 Self::arbitrary(&mut unstructured).unwrap_or_default()
8043 }
8044}
8045impl Default for CAMERA_TRIGGER_DATA {
8046 fn default() -> Self {
8047 Self::DEFAULT.clone()
8048 }
8049}
8050impl MessageData for CAMERA_TRIGGER_DATA {
8051 type Message = MavMessage;
8052 const ID: u32 = 112u32;
8053 const NAME: &'static str = "CAMERA_TRIGGER";
8054 const EXTRA_CRC: u8 = 174u8;
8055 const ENCODED_LEN: usize = 12usize;
8056 fn deser(
8057 _version: MavlinkVersion,
8058 __input: &[u8],
8059 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8060 let avail_len = __input.len();
8061 let mut payload_buf = [0; Self::ENCODED_LEN];
8062 let mut buf = if avail_len < Self::ENCODED_LEN {
8063 payload_buf[0..avail_len].copy_from_slice(__input);
8064 Bytes::new(&payload_buf)
8065 } else {
8066 Bytes::new(__input)
8067 };
8068 let mut __struct = Self::default();
8069 __struct.time_usec = buf.get_u64_le();
8070 __struct.seq = buf.get_u32_le();
8071 Ok(__struct)
8072 }
8073 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8074 let mut __tmp = BytesMut::new(bytes);
8075 #[allow(clippy::absurd_extreme_comparisons)]
8076 #[allow(unused_comparisons)]
8077 if __tmp.remaining() < Self::ENCODED_LEN {
8078 panic!(
8079 "buffer is too small (need {} bytes, but got {})",
8080 Self::ENCODED_LEN,
8081 __tmp.remaining(),
8082 )
8083 }
8084 __tmp.put_u64_le(self.time_usec);
8085 __tmp.put_u32_le(self.seq);
8086 if matches!(version, MavlinkVersion::V2) {
8087 let len = __tmp.len();
8088 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8089 } else {
8090 __tmp.len()
8091 }
8092 }
8093}
8094#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8095#[doc = ""]
8096#[doc = "ID: 387"]
8097#[derive(Debug, Clone, PartialEq)]
8098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8099#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8100#[cfg_attr(feature = "ts", derive(TS))]
8101#[cfg_attr(feature = "ts", ts(export))]
8102pub struct CANFD_FRAME_DATA {
8103 #[doc = "Frame ID"]
8104 pub id: u32,
8105 #[doc = "System ID."]
8106 pub target_system: u8,
8107 #[doc = "Component ID."]
8108 pub target_component: u8,
8109 #[doc = "bus number"]
8110 pub bus: u8,
8111 #[doc = "Frame length"]
8112 pub len: u8,
8113 #[doc = "Frame data"]
8114 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8115 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8116 pub data: [u8; 64],
8117}
8118impl CANFD_FRAME_DATA {
8119 pub const ENCODED_LEN: usize = 72usize;
8120 pub const DEFAULT: Self = Self {
8121 id: 0_u32,
8122 target_system: 0_u8,
8123 target_component: 0_u8,
8124 bus: 0_u8,
8125 len: 0_u8,
8126 data: [0_u8; 64usize],
8127 };
8128 #[cfg(feature = "arbitrary")]
8129 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8130 use arbitrary::{Arbitrary, Unstructured};
8131 let mut buf = [0u8; 1024];
8132 rng.fill_bytes(&mut buf);
8133 let mut unstructured = Unstructured::new(&buf);
8134 Self::arbitrary(&mut unstructured).unwrap_or_default()
8135 }
8136}
8137impl Default for CANFD_FRAME_DATA {
8138 fn default() -> Self {
8139 Self::DEFAULT.clone()
8140 }
8141}
8142impl MessageData for CANFD_FRAME_DATA {
8143 type Message = MavMessage;
8144 const ID: u32 = 387u32;
8145 const NAME: &'static str = "CANFD_FRAME";
8146 const EXTRA_CRC: u8 = 4u8;
8147 const ENCODED_LEN: usize = 72usize;
8148 fn deser(
8149 _version: MavlinkVersion,
8150 __input: &[u8],
8151 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8152 let avail_len = __input.len();
8153 let mut payload_buf = [0; Self::ENCODED_LEN];
8154 let mut buf = if avail_len < Self::ENCODED_LEN {
8155 payload_buf[0..avail_len].copy_from_slice(__input);
8156 Bytes::new(&payload_buf)
8157 } else {
8158 Bytes::new(__input)
8159 };
8160 let mut __struct = Self::default();
8161 __struct.id = buf.get_u32_le();
8162 __struct.target_system = buf.get_u8();
8163 __struct.target_component = buf.get_u8();
8164 __struct.bus = buf.get_u8();
8165 __struct.len = buf.get_u8();
8166 for v in &mut __struct.data {
8167 let val = buf.get_u8();
8168 *v = val;
8169 }
8170 Ok(__struct)
8171 }
8172 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8173 let mut __tmp = BytesMut::new(bytes);
8174 #[allow(clippy::absurd_extreme_comparisons)]
8175 #[allow(unused_comparisons)]
8176 if __tmp.remaining() < Self::ENCODED_LEN {
8177 panic!(
8178 "buffer is too small (need {} bytes, but got {})",
8179 Self::ENCODED_LEN,
8180 __tmp.remaining(),
8181 )
8182 }
8183 __tmp.put_u32_le(self.id);
8184 __tmp.put_u8(self.target_system);
8185 __tmp.put_u8(self.target_component);
8186 __tmp.put_u8(self.bus);
8187 __tmp.put_u8(self.len);
8188 for val in &self.data {
8189 __tmp.put_u8(*val);
8190 }
8191 if matches!(version, MavlinkVersion::V2) {
8192 let len = __tmp.len();
8193 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8194 } else {
8195 __tmp.len()
8196 }
8197 }
8198}
8199#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8200#[doc = ""]
8201#[doc = "ID: 388"]
8202#[derive(Debug, Clone, PartialEq)]
8203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8204#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8205#[cfg_attr(feature = "ts", derive(TS))]
8206#[cfg_attr(feature = "ts", ts(export))]
8207pub struct CAN_FILTER_MODIFY_DATA {
8208 #[doc = "filter IDs, length num_ids"]
8209 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8210 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8211 pub ids: [u16; 16],
8212 #[doc = "System ID."]
8213 pub target_system: u8,
8214 #[doc = "Component ID."]
8215 pub target_component: u8,
8216 #[doc = "bus number"]
8217 pub bus: u8,
8218 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8219 pub operation: CanFilterOp,
8220 #[doc = "number of IDs in filter list"]
8221 pub num_ids: u8,
8222}
8223impl CAN_FILTER_MODIFY_DATA {
8224 pub const ENCODED_LEN: usize = 37usize;
8225 pub const DEFAULT: Self = Self {
8226 ids: [0_u16; 16usize],
8227 target_system: 0_u8,
8228 target_component: 0_u8,
8229 bus: 0_u8,
8230 operation: CanFilterOp::DEFAULT,
8231 num_ids: 0_u8,
8232 };
8233 #[cfg(feature = "arbitrary")]
8234 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8235 use arbitrary::{Arbitrary, Unstructured};
8236 let mut buf = [0u8; 1024];
8237 rng.fill_bytes(&mut buf);
8238 let mut unstructured = Unstructured::new(&buf);
8239 Self::arbitrary(&mut unstructured).unwrap_or_default()
8240 }
8241}
8242impl Default for CAN_FILTER_MODIFY_DATA {
8243 fn default() -> Self {
8244 Self::DEFAULT.clone()
8245 }
8246}
8247impl MessageData for CAN_FILTER_MODIFY_DATA {
8248 type Message = MavMessage;
8249 const ID: u32 = 388u32;
8250 const NAME: &'static str = "CAN_FILTER_MODIFY";
8251 const EXTRA_CRC: u8 = 8u8;
8252 const ENCODED_LEN: usize = 37usize;
8253 fn deser(
8254 _version: MavlinkVersion,
8255 __input: &[u8],
8256 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8257 let avail_len = __input.len();
8258 let mut payload_buf = [0; Self::ENCODED_LEN];
8259 let mut buf = if avail_len < Self::ENCODED_LEN {
8260 payload_buf[0..avail_len].copy_from_slice(__input);
8261 Bytes::new(&payload_buf)
8262 } else {
8263 Bytes::new(__input)
8264 };
8265 let mut __struct = Self::default();
8266 for v in &mut __struct.ids {
8267 let val = buf.get_u16_le();
8268 *v = val;
8269 }
8270 __struct.target_system = buf.get_u8();
8271 __struct.target_component = buf.get_u8();
8272 __struct.bus = buf.get_u8();
8273 let tmp = buf.get_u8();
8274 __struct.operation =
8275 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8276 enum_type: "CanFilterOp",
8277 value: tmp as u32,
8278 })?;
8279 __struct.num_ids = buf.get_u8();
8280 Ok(__struct)
8281 }
8282 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8283 let mut __tmp = BytesMut::new(bytes);
8284 #[allow(clippy::absurd_extreme_comparisons)]
8285 #[allow(unused_comparisons)]
8286 if __tmp.remaining() < Self::ENCODED_LEN {
8287 panic!(
8288 "buffer is too small (need {} bytes, but got {})",
8289 Self::ENCODED_LEN,
8290 __tmp.remaining(),
8291 )
8292 }
8293 for val in &self.ids {
8294 __tmp.put_u16_le(*val);
8295 }
8296 __tmp.put_u8(self.target_system);
8297 __tmp.put_u8(self.target_component);
8298 __tmp.put_u8(self.bus);
8299 __tmp.put_u8(self.operation as u8);
8300 __tmp.put_u8(self.num_ids);
8301 if matches!(version, MavlinkVersion::V2) {
8302 let len = __tmp.len();
8303 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8304 } else {
8305 __tmp.len()
8306 }
8307 }
8308}
8309#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8310#[doc = ""]
8311#[doc = "ID: 386"]
8312#[derive(Debug, Clone, PartialEq)]
8313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8314#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8315#[cfg_attr(feature = "ts", derive(TS))]
8316#[cfg_attr(feature = "ts", ts(export))]
8317pub struct CAN_FRAME_DATA {
8318 #[doc = "Frame ID"]
8319 pub id: u32,
8320 #[doc = "System ID."]
8321 pub target_system: u8,
8322 #[doc = "Component ID."]
8323 pub target_component: u8,
8324 #[doc = "Bus number"]
8325 pub bus: u8,
8326 #[doc = "Frame length"]
8327 pub len: u8,
8328 #[doc = "Frame data"]
8329 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8330 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8331 pub data: [u8; 8],
8332}
8333impl CAN_FRAME_DATA {
8334 pub const ENCODED_LEN: usize = 16usize;
8335 pub const DEFAULT: Self = Self {
8336 id: 0_u32,
8337 target_system: 0_u8,
8338 target_component: 0_u8,
8339 bus: 0_u8,
8340 len: 0_u8,
8341 data: [0_u8; 8usize],
8342 };
8343 #[cfg(feature = "arbitrary")]
8344 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8345 use arbitrary::{Arbitrary, Unstructured};
8346 let mut buf = [0u8; 1024];
8347 rng.fill_bytes(&mut buf);
8348 let mut unstructured = Unstructured::new(&buf);
8349 Self::arbitrary(&mut unstructured).unwrap_or_default()
8350 }
8351}
8352impl Default for CAN_FRAME_DATA {
8353 fn default() -> Self {
8354 Self::DEFAULT.clone()
8355 }
8356}
8357impl MessageData for CAN_FRAME_DATA {
8358 type Message = MavMessage;
8359 const ID: u32 = 386u32;
8360 const NAME: &'static str = "CAN_FRAME";
8361 const EXTRA_CRC: u8 = 132u8;
8362 const ENCODED_LEN: usize = 16usize;
8363 fn deser(
8364 _version: MavlinkVersion,
8365 __input: &[u8],
8366 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8367 let avail_len = __input.len();
8368 let mut payload_buf = [0; Self::ENCODED_LEN];
8369 let mut buf = if avail_len < Self::ENCODED_LEN {
8370 payload_buf[0..avail_len].copy_from_slice(__input);
8371 Bytes::new(&payload_buf)
8372 } else {
8373 Bytes::new(__input)
8374 };
8375 let mut __struct = Self::default();
8376 __struct.id = buf.get_u32_le();
8377 __struct.target_system = buf.get_u8();
8378 __struct.target_component = buf.get_u8();
8379 __struct.bus = buf.get_u8();
8380 __struct.len = buf.get_u8();
8381 for v in &mut __struct.data {
8382 let val = buf.get_u8();
8383 *v = val;
8384 }
8385 Ok(__struct)
8386 }
8387 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8388 let mut __tmp = BytesMut::new(bytes);
8389 #[allow(clippy::absurd_extreme_comparisons)]
8390 #[allow(unused_comparisons)]
8391 if __tmp.remaining() < Self::ENCODED_LEN {
8392 panic!(
8393 "buffer is too small (need {} bytes, but got {})",
8394 Self::ENCODED_LEN,
8395 __tmp.remaining(),
8396 )
8397 }
8398 __tmp.put_u32_le(self.id);
8399 __tmp.put_u8(self.target_system);
8400 __tmp.put_u8(self.target_component);
8401 __tmp.put_u8(self.bus);
8402 __tmp.put_u8(self.len);
8403 for val in &self.data {
8404 __tmp.put_u8(*val);
8405 }
8406 if matches!(version, MavlinkVersion::V2) {
8407 let len = __tmp.len();
8408 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8409 } else {
8410 __tmp.len()
8411 }
8412 }
8413}
8414#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8415#[doc = ""]
8416#[doc = "ID: 336"]
8417#[derive(Debug, Clone, PartialEq)]
8418#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8420#[cfg_attr(feature = "ts", derive(TS))]
8421#[cfg_attr(feature = "ts", ts(export))]
8422pub struct CELLULAR_CONFIG_DATA {
8423 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8424 pub enable_lte: u8,
8425 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8426 pub enable_pin: u8,
8427 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8428 #[cfg_attr(
8429 feature = "serde",
8430 serde(
8431 serialize_with = "crate::nulstr::serialize::<_, 16>",
8432 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8433 )
8434 )]
8435 #[cfg_attr(feature = "ts", ts(type = "string"))]
8436 pub pin: [u8; 16],
8437 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8438 #[cfg_attr(
8439 feature = "serde",
8440 serde(
8441 serialize_with = "crate::nulstr::serialize::<_, 16>",
8442 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8443 )
8444 )]
8445 #[cfg_attr(feature = "ts", ts(type = "string"))]
8446 pub new_pin: [u8; 16],
8447 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8448 #[cfg_attr(
8449 feature = "serde",
8450 serde(
8451 serialize_with = "crate::nulstr::serialize::<_, 32>",
8452 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
8453 )
8454 )]
8455 #[cfg_attr(feature = "ts", ts(type = "string"))]
8456 pub apn: [u8; 32],
8457 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8458 #[cfg_attr(
8459 feature = "serde",
8460 serde(
8461 serialize_with = "crate::nulstr::serialize::<_, 16>",
8462 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
8463 )
8464 )]
8465 #[cfg_attr(feature = "ts", ts(type = "string"))]
8466 pub puk: [u8; 16],
8467 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8468 pub roaming: u8,
8469 #[doc = "Message acceptance response (sent back to GS)."]
8470 pub response: CellularConfigResponse,
8471}
8472impl CELLULAR_CONFIG_DATA {
8473 pub const ENCODED_LEN: usize = 84usize;
8474 pub const DEFAULT: Self = Self {
8475 enable_lte: 0_u8,
8476 enable_pin: 0_u8,
8477 pin: [0_u8; 16usize],
8478 new_pin: [0_u8; 16usize],
8479 apn: [0_u8; 32usize],
8480 puk: [0_u8; 16usize],
8481 roaming: 0_u8,
8482 response: CellularConfigResponse::DEFAULT,
8483 };
8484 #[cfg(feature = "arbitrary")]
8485 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8486 use arbitrary::{Arbitrary, Unstructured};
8487 let mut buf = [0u8; 1024];
8488 rng.fill_bytes(&mut buf);
8489 let mut unstructured = Unstructured::new(&buf);
8490 Self::arbitrary(&mut unstructured).unwrap_or_default()
8491 }
8492}
8493impl Default for CELLULAR_CONFIG_DATA {
8494 fn default() -> Self {
8495 Self::DEFAULT.clone()
8496 }
8497}
8498impl MessageData for CELLULAR_CONFIG_DATA {
8499 type Message = MavMessage;
8500 const ID: u32 = 336u32;
8501 const NAME: &'static str = "CELLULAR_CONFIG";
8502 const EXTRA_CRC: u8 = 245u8;
8503 const ENCODED_LEN: usize = 84usize;
8504 fn deser(
8505 _version: MavlinkVersion,
8506 __input: &[u8],
8507 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8508 let avail_len = __input.len();
8509 let mut payload_buf = [0; Self::ENCODED_LEN];
8510 let mut buf = if avail_len < Self::ENCODED_LEN {
8511 payload_buf[0..avail_len].copy_from_slice(__input);
8512 Bytes::new(&payload_buf)
8513 } else {
8514 Bytes::new(__input)
8515 };
8516 let mut __struct = Self::default();
8517 __struct.enable_lte = buf.get_u8();
8518 __struct.enable_pin = buf.get_u8();
8519 for v in &mut __struct.pin {
8520 let val = buf.get_u8();
8521 *v = val;
8522 }
8523 for v in &mut __struct.new_pin {
8524 let val = buf.get_u8();
8525 *v = val;
8526 }
8527 for v in &mut __struct.apn {
8528 let val = buf.get_u8();
8529 *v = val;
8530 }
8531 for v in &mut __struct.puk {
8532 let val = buf.get_u8();
8533 *v = val;
8534 }
8535 __struct.roaming = buf.get_u8();
8536 let tmp = buf.get_u8();
8537 __struct.response =
8538 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8539 enum_type: "CellularConfigResponse",
8540 value: tmp as u32,
8541 })?;
8542 Ok(__struct)
8543 }
8544 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8545 let mut __tmp = BytesMut::new(bytes);
8546 #[allow(clippy::absurd_extreme_comparisons)]
8547 #[allow(unused_comparisons)]
8548 if __tmp.remaining() < Self::ENCODED_LEN {
8549 panic!(
8550 "buffer is too small (need {} bytes, but got {})",
8551 Self::ENCODED_LEN,
8552 __tmp.remaining(),
8553 )
8554 }
8555 __tmp.put_u8(self.enable_lte);
8556 __tmp.put_u8(self.enable_pin);
8557 for val in &self.pin {
8558 __tmp.put_u8(*val);
8559 }
8560 for val in &self.new_pin {
8561 __tmp.put_u8(*val);
8562 }
8563 for val in &self.apn {
8564 __tmp.put_u8(*val);
8565 }
8566 for val in &self.puk {
8567 __tmp.put_u8(*val);
8568 }
8569 __tmp.put_u8(self.roaming);
8570 __tmp.put_u8(self.response as u8);
8571 if matches!(version, MavlinkVersion::V2) {
8572 let len = __tmp.len();
8573 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8574 } else {
8575 __tmp.len()
8576 }
8577 }
8578}
8579#[doc = "Report current used cellular network status."]
8580#[doc = ""]
8581#[doc = "ID: 334"]
8582#[derive(Debug, Clone, PartialEq)]
8583#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8585#[cfg_attr(feature = "ts", derive(TS))]
8586#[cfg_attr(feature = "ts", ts(export))]
8587pub struct CELLULAR_STATUS_DATA {
8588 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8589 pub mcc: u16,
8590 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8591 pub mnc: u16,
8592 #[doc = "Location area code. If unknown, set to 0"]
8593 pub lac: u16,
8594 #[doc = "Cellular modem status"]
8595 pub status: CellularStatusFlag,
8596 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8597 pub failure_reason: CellularNetworkFailedReason,
8598 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8599 pub mavtype: CellularNetworkRadioType,
8600 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8601 pub quality: u8,
8602}
8603impl CELLULAR_STATUS_DATA {
8604 pub const ENCODED_LEN: usize = 10usize;
8605 pub const DEFAULT: Self = Self {
8606 mcc: 0_u16,
8607 mnc: 0_u16,
8608 lac: 0_u16,
8609 status: CellularStatusFlag::DEFAULT,
8610 failure_reason: CellularNetworkFailedReason::DEFAULT,
8611 mavtype: CellularNetworkRadioType::DEFAULT,
8612 quality: 0_u8,
8613 };
8614 #[cfg(feature = "arbitrary")]
8615 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8616 use arbitrary::{Arbitrary, Unstructured};
8617 let mut buf = [0u8; 1024];
8618 rng.fill_bytes(&mut buf);
8619 let mut unstructured = Unstructured::new(&buf);
8620 Self::arbitrary(&mut unstructured).unwrap_or_default()
8621 }
8622}
8623impl Default for CELLULAR_STATUS_DATA {
8624 fn default() -> Self {
8625 Self::DEFAULT.clone()
8626 }
8627}
8628impl MessageData for CELLULAR_STATUS_DATA {
8629 type Message = MavMessage;
8630 const ID: u32 = 334u32;
8631 const NAME: &'static str = "CELLULAR_STATUS";
8632 const EXTRA_CRC: u8 = 72u8;
8633 const ENCODED_LEN: usize = 10usize;
8634 fn deser(
8635 _version: MavlinkVersion,
8636 __input: &[u8],
8637 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8638 let avail_len = __input.len();
8639 let mut payload_buf = [0; Self::ENCODED_LEN];
8640 let mut buf = if avail_len < Self::ENCODED_LEN {
8641 payload_buf[0..avail_len].copy_from_slice(__input);
8642 Bytes::new(&payload_buf)
8643 } else {
8644 Bytes::new(__input)
8645 };
8646 let mut __struct = Self::default();
8647 __struct.mcc = buf.get_u16_le();
8648 __struct.mnc = buf.get_u16_le();
8649 __struct.lac = buf.get_u16_le();
8650 let tmp = buf.get_u8();
8651 __struct.status =
8652 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8653 enum_type: "CellularStatusFlag",
8654 value: tmp as u32,
8655 })?;
8656 let tmp = buf.get_u8();
8657 __struct.failure_reason =
8658 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8659 enum_type: "CellularNetworkFailedReason",
8660 value: tmp as u32,
8661 })?;
8662 let tmp = buf.get_u8();
8663 __struct.mavtype =
8664 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8665 enum_type: "CellularNetworkRadioType",
8666 value: tmp as u32,
8667 })?;
8668 __struct.quality = buf.get_u8();
8669 Ok(__struct)
8670 }
8671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8672 let mut __tmp = BytesMut::new(bytes);
8673 #[allow(clippy::absurd_extreme_comparisons)]
8674 #[allow(unused_comparisons)]
8675 if __tmp.remaining() < Self::ENCODED_LEN {
8676 panic!(
8677 "buffer is too small (need {} bytes, but got {})",
8678 Self::ENCODED_LEN,
8679 __tmp.remaining(),
8680 )
8681 }
8682 __tmp.put_u16_le(self.mcc);
8683 __tmp.put_u16_le(self.mnc);
8684 __tmp.put_u16_le(self.lac);
8685 __tmp.put_u8(self.status as u8);
8686 __tmp.put_u8(self.failure_reason as u8);
8687 __tmp.put_u8(self.mavtype as u8);
8688 __tmp.put_u8(self.quality);
8689 if matches!(version, MavlinkVersion::V2) {
8690 let len = __tmp.len();
8691 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8692 } else {
8693 __tmp.len()
8694 }
8695 }
8696}
8697#[doc = "Request to control this MAV."]
8698#[doc = ""]
8699#[doc = "ID: 5"]
8700#[derive(Debug, Clone, PartialEq)]
8701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8703#[cfg_attr(feature = "ts", derive(TS))]
8704#[cfg_attr(feature = "ts", ts(export))]
8705pub struct CHANGE_OPERATOR_CONTROL_DATA {
8706 #[doc = "System the GCS requests control for"]
8707 pub target_system: u8,
8708 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8709 pub control_request: u8,
8710 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8711 pub version: u8,
8712 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8713 #[cfg_attr(
8714 feature = "serde",
8715 serde(
8716 serialize_with = "crate::nulstr::serialize::<_, 25>",
8717 deserialize_with = "crate::nulstr::deserialize::<_, 25>"
8718 )
8719 )]
8720 #[cfg_attr(feature = "ts", ts(type = "string"))]
8721 pub passkey: [u8; 25],
8722}
8723impl CHANGE_OPERATOR_CONTROL_DATA {
8724 pub const ENCODED_LEN: usize = 28usize;
8725 pub const DEFAULT: Self = Self {
8726 target_system: 0_u8,
8727 control_request: 0_u8,
8728 version: 0_u8,
8729 passkey: [0_u8; 25usize],
8730 };
8731 #[cfg(feature = "arbitrary")]
8732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8733 use arbitrary::{Arbitrary, Unstructured};
8734 let mut buf = [0u8; 1024];
8735 rng.fill_bytes(&mut buf);
8736 let mut unstructured = Unstructured::new(&buf);
8737 Self::arbitrary(&mut unstructured).unwrap_or_default()
8738 }
8739}
8740impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8741 fn default() -> Self {
8742 Self::DEFAULT.clone()
8743 }
8744}
8745impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8746 type Message = MavMessage;
8747 const ID: u32 = 5u32;
8748 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8749 const EXTRA_CRC: u8 = 217u8;
8750 const ENCODED_LEN: usize = 28usize;
8751 fn deser(
8752 _version: MavlinkVersion,
8753 __input: &[u8],
8754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8755 let avail_len = __input.len();
8756 let mut payload_buf = [0; Self::ENCODED_LEN];
8757 let mut buf = if avail_len < Self::ENCODED_LEN {
8758 payload_buf[0..avail_len].copy_from_slice(__input);
8759 Bytes::new(&payload_buf)
8760 } else {
8761 Bytes::new(__input)
8762 };
8763 let mut __struct = Self::default();
8764 __struct.target_system = buf.get_u8();
8765 __struct.control_request = buf.get_u8();
8766 __struct.version = buf.get_u8();
8767 for v in &mut __struct.passkey {
8768 let val = buf.get_u8();
8769 *v = val;
8770 }
8771 Ok(__struct)
8772 }
8773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8774 let mut __tmp = BytesMut::new(bytes);
8775 #[allow(clippy::absurd_extreme_comparisons)]
8776 #[allow(unused_comparisons)]
8777 if __tmp.remaining() < Self::ENCODED_LEN {
8778 panic!(
8779 "buffer is too small (need {} bytes, but got {})",
8780 Self::ENCODED_LEN,
8781 __tmp.remaining(),
8782 )
8783 }
8784 __tmp.put_u8(self.target_system);
8785 __tmp.put_u8(self.control_request);
8786 __tmp.put_u8(self.version);
8787 for val in &self.passkey {
8788 __tmp.put_u8(*val);
8789 }
8790 if matches!(version, MavlinkVersion::V2) {
8791 let len = __tmp.len();
8792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8793 } else {
8794 __tmp.len()
8795 }
8796 }
8797}
8798#[doc = "Accept / deny control of this MAV."]
8799#[doc = ""]
8800#[doc = "ID: 6"]
8801#[derive(Debug, Clone, PartialEq)]
8802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8804#[cfg_attr(feature = "ts", derive(TS))]
8805#[cfg_attr(feature = "ts", ts(export))]
8806pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8807 #[doc = "ID of the GCS this message"]
8808 pub gcs_system_id: u8,
8809 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8810 pub control_request: u8,
8811 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8812 pub ack: u8,
8813}
8814impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8815 pub const ENCODED_LEN: usize = 3usize;
8816 pub const DEFAULT: Self = Self {
8817 gcs_system_id: 0_u8,
8818 control_request: 0_u8,
8819 ack: 0_u8,
8820 };
8821 #[cfg(feature = "arbitrary")]
8822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8823 use arbitrary::{Arbitrary, Unstructured};
8824 let mut buf = [0u8; 1024];
8825 rng.fill_bytes(&mut buf);
8826 let mut unstructured = Unstructured::new(&buf);
8827 Self::arbitrary(&mut unstructured).unwrap_or_default()
8828 }
8829}
8830impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8831 fn default() -> Self {
8832 Self::DEFAULT.clone()
8833 }
8834}
8835impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8836 type Message = MavMessage;
8837 const ID: u32 = 6u32;
8838 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8839 const EXTRA_CRC: u8 = 104u8;
8840 const ENCODED_LEN: usize = 3usize;
8841 fn deser(
8842 _version: MavlinkVersion,
8843 __input: &[u8],
8844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8845 let avail_len = __input.len();
8846 let mut payload_buf = [0; Self::ENCODED_LEN];
8847 let mut buf = if avail_len < Self::ENCODED_LEN {
8848 payload_buf[0..avail_len].copy_from_slice(__input);
8849 Bytes::new(&payload_buf)
8850 } else {
8851 Bytes::new(__input)
8852 };
8853 let mut __struct = Self::default();
8854 __struct.gcs_system_id = buf.get_u8();
8855 __struct.control_request = buf.get_u8();
8856 __struct.ack = buf.get_u8();
8857 Ok(__struct)
8858 }
8859 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8860 let mut __tmp = BytesMut::new(bytes);
8861 #[allow(clippy::absurd_extreme_comparisons)]
8862 #[allow(unused_comparisons)]
8863 if __tmp.remaining() < Self::ENCODED_LEN {
8864 panic!(
8865 "buffer is too small (need {} bytes, but got {})",
8866 Self::ENCODED_LEN,
8867 __tmp.remaining(),
8868 )
8869 }
8870 __tmp.put_u8(self.gcs_system_id);
8871 __tmp.put_u8(self.control_request);
8872 __tmp.put_u8(self.ack);
8873 if matches!(version, MavlinkVersion::V2) {
8874 let len = __tmp.len();
8875 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8876 } else {
8877 __tmp.len()
8878 }
8879 }
8880}
8881#[doc = "Information about a potential collision."]
8882#[doc = ""]
8883#[doc = "ID: 247"]
8884#[derive(Debug, Clone, PartialEq)]
8885#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8887#[cfg_attr(feature = "ts", derive(TS))]
8888#[cfg_attr(feature = "ts", ts(export))]
8889pub struct COLLISION_DATA {
8890 #[doc = "Unique identifier, domain based on src field"]
8891 pub id: u32,
8892 #[doc = "Estimated time until collision occurs"]
8893 pub time_to_minimum_delta: f32,
8894 #[doc = "Closest vertical distance between vehicle and object"]
8895 pub altitude_minimum_delta: f32,
8896 #[doc = "Closest horizontal distance between vehicle and object"]
8897 pub horizontal_minimum_delta: f32,
8898 #[doc = "Collision data source"]
8899 pub src: MavCollisionSrc,
8900 #[doc = "Action that is being taken to avoid this collision"]
8901 pub action: MavCollisionAction,
8902 #[doc = "How concerned the aircraft is about this collision"]
8903 pub threat_level: MavCollisionThreatLevel,
8904}
8905impl COLLISION_DATA {
8906 pub const ENCODED_LEN: usize = 19usize;
8907 pub const DEFAULT: Self = Self {
8908 id: 0_u32,
8909 time_to_minimum_delta: 0.0_f32,
8910 altitude_minimum_delta: 0.0_f32,
8911 horizontal_minimum_delta: 0.0_f32,
8912 src: MavCollisionSrc::DEFAULT,
8913 action: MavCollisionAction::DEFAULT,
8914 threat_level: MavCollisionThreatLevel::DEFAULT,
8915 };
8916 #[cfg(feature = "arbitrary")]
8917 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8918 use arbitrary::{Arbitrary, Unstructured};
8919 let mut buf = [0u8; 1024];
8920 rng.fill_bytes(&mut buf);
8921 let mut unstructured = Unstructured::new(&buf);
8922 Self::arbitrary(&mut unstructured).unwrap_or_default()
8923 }
8924}
8925impl Default for COLLISION_DATA {
8926 fn default() -> Self {
8927 Self::DEFAULT.clone()
8928 }
8929}
8930impl MessageData for COLLISION_DATA {
8931 type Message = MavMessage;
8932 const ID: u32 = 247u32;
8933 const NAME: &'static str = "COLLISION";
8934 const EXTRA_CRC: u8 = 81u8;
8935 const ENCODED_LEN: usize = 19usize;
8936 fn deser(
8937 _version: MavlinkVersion,
8938 __input: &[u8],
8939 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8940 let avail_len = __input.len();
8941 let mut payload_buf = [0; Self::ENCODED_LEN];
8942 let mut buf = if avail_len < Self::ENCODED_LEN {
8943 payload_buf[0..avail_len].copy_from_slice(__input);
8944 Bytes::new(&payload_buf)
8945 } else {
8946 Bytes::new(__input)
8947 };
8948 let mut __struct = Self::default();
8949 __struct.id = buf.get_u32_le();
8950 __struct.time_to_minimum_delta = buf.get_f32_le();
8951 __struct.altitude_minimum_delta = buf.get_f32_le();
8952 __struct.horizontal_minimum_delta = buf.get_f32_le();
8953 let tmp = buf.get_u8();
8954 __struct.src =
8955 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8956 enum_type: "MavCollisionSrc",
8957 value: tmp as u32,
8958 })?;
8959 let tmp = buf.get_u8();
8960 __struct.action =
8961 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8962 enum_type: "MavCollisionAction",
8963 value: tmp as u32,
8964 })?;
8965 let tmp = buf.get_u8();
8966 __struct.threat_level =
8967 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8968 enum_type: "MavCollisionThreatLevel",
8969 value: tmp as u32,
8970 })?;
8971 Ok(__struct)
8972 }
8973 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8974 let mut __tmp = BytesMut::new(bytes);
8975 #[allow(clippy::absurd_extreme_comparisons)]
8976 #[allow(unused_comparisons)]
8977 if __tmp.remaining() < Self::ENCODED_LEN {
8978 panic!(
8979 "buffer is too small (need {} bytes, but got {})",
8980 Self::ENCODED_LEN,
8981 __tmp.remaining(),
8982 )
8983 }
8984 __tmp.put_u32_le(self.id);
8985 __tmp.put_f32_le(self.time_to_minimum_delta);
8986 __tmp.put_f32_le(self.altitude_minimum_delta);
8987 __tmp.put_f32_le(self.horizontal_minimum_delta);
8988 __tmp.put_u8(self.src as u8);
8989 __tmp.put_u8(self.action as u8);
8990 __tmp.put_u8(self.threat_level as u8);
8991 if matches!(version, MavlinkVersion::V2) {
8992 let len = __tmp.len();
8993 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8994 } else {
8995 __tmp.len()
8996 }
8997 }
8998}
8999#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9000#[doc = ""]
9001#[doc = "ID: 77"]
9002#[derive(Debug, Clone, PartialEq)]
9003#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9004#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9005#[cfg_attr(feature = "ts", derive(TS))]
9006#[cfg_attr(feature = "ts", ts(export))]
9007pub struct COMMAND_ACK_DATA {
9008 #[doc = "Command ID (of acknowledged command)."]
9009 pub command: MavCmd,
9010 #[doc = "Result of command."]
9011 pub result: MavResult,
9012 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9013 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9014 pub progress: u8,
9015 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9016 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9017 pub result_param2: i32,
9018 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9019 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9020 pub target_system: u8,
9021 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9022 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9023 pub target_component: u8,
9024}
9025impl COMMAND_ACK_DATA {
9026 pub const ENCODED_LEN: usize = 10usize;
9027 pub const DEFAULT: Self = Self {
9028 command: MavCmd::DEFAULT,
9029 result: MavResult::DEFAULT,
9030 progress: 0_u8,
9031 result_param2: 0_i32,
9032 target_system: 0_u8,
9033 target_component: 0_u8,
9034 };
9035 #[cfg(feature = "arbitrary")]
9036 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9037 use arbitrary::{Arbitrary, Unstructured};
9038 let mut buf = [0u8; 1024];
9039 rng.fill_bytes(&mut buf);
9040 let mut unstructured = Unstructured::new(&buf);
9041 Self::arbitrary(&mut unstructured).unwrap_or_default()
9042 }
9043}
9044impl Default for COMMAND_ACK_DATA {
9045 fn default() -> Self {
9046 Self::DEFAULT.clone()
9047 }
9048}
9049impl MessageData for COMMAND_ACK_DATA {
9050 type Message = MavMessage;
9051 const ID: u32 = 77u32;
9052 const NAME: &'static str = "COMMAND_ACK";
9053 const EXTRA_CRC: u8 = 143u8;
9054 const ENCODED_LEN: usize = 10usize;
9055 fn deser(
9056 _version: MavlinkVersion,
9057 __input: &[u8],
9058 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9059 let avail_len = __input.len();
9060 let mut payload_buf = [0; Self::ENCODED_LEN];
9061 let mut buf = if avail_len < Self::ENCODED_LEN {
9062 payload_buf[0..avail_len].copy_from_slice(__input);
9063 Bytes::new(&payload_buf)
9064 } else {
9065 Bytes::new(__input)
9066 };
9067 let mut __struct = Self::default();
9068 let tmp = buf.get_u16_le();
9069 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9070 ::mavlink_core::error::ParserError::InvalidEnum {
9071 enum_type: "MavCmd",
9072 value: tmp as u32,
9073 },
9074 )?;
9075 let tmp = buf.get_u8();
9076 __struct.result =
9077 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9078 enum_type: "MavResult",
9079 value: tmp as u32,
9080 })?;
9081 __struct.progress = buf.get_u8();
9082 __struct.result_param2 = buf.get_i32_le();
9083 __struct.target_system = buf.get_u8();
9084 __struct.target_component = buf.get_u8();
9085 Ok(__struct)
9086 }
9087 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9088 let mut __tmp = BytesMut::new(bytes);
9089 #[allow(clippy::absurd_extreme_comparisons)]
9090 #[allow(unused_comparisons)]
9091 if __tmp.remaining() < Self::ENCODED_LEN {
9092 panic!(
9093 "buffer is too small (need {} bytes, but got {})",
9094 Self::ENCODED_LEN,
9095 __tmp.remaining(),
9096 )
9097 }
9098 __tmp.put_u16_le(self.command as u16);
9099 __tmp.put_u8(self.result as u8);
9100 if matches!(version, MavlinkVersion::V2) {
9101 __tmp.put_u8(self.progress);
9102 __tmp.put_i32_le(self.result_param2);
9103 __tmp.put_u8(self.target_system);
9104 __tmp.put_u8(self.target_component);
9105 let len = __tmp.len();
9106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9107 } else {
9108 __tmp.len()
9109 }
9110 }
9111}
9112#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9113#[doc = ""]
9114#[doc = "ID: 80"]
9115#[derive(Debug, Clone, PartialEq)]
9116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9118#[cfg_attr(feature = "ts", derive(TS))]
9119#[cfg_attr(feature = "ts", ts(export))]
9120pub struct COMMAND_CANCEL_DATA {
9121 #[doc = "Command ID (of command to cancel)."]
9122 pub command: MavCmd,
9123 #[doc = "System executing long running command. Should not be broadcast (0)."]
9124 pub target_system: u8,
9125 #[doc = "Component executing long running command."]
9126 pub target_component: u8,
9127}
9128impl COMMAND_CANCEL_DATA {
9129 pub const ENCODED_LEN: usize = 4usize;
9130 pub const DEFAULT: Self = Self {
9131 command: MavCmd::DEFAULT,
9132 target_system: 0_u8,
9133 target_component: 0_u8,
9134 };
9135 #[cfg(feature = "arbitrary")]
9136 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9137 use arbitrary::{Arbitrary, Unstructured};
9138 let mut buf = [0u8; 1024];
9139 rng.fill_bytes(&mut buf);
9140 let mut unstructured = Unstructured::new(&buf);
9141 Self::arbitrary(&mut unstructured).unwrap_or_default()
9142 }
9143}
9144impl Default for COMMAND_CANCEL_DATA {
9145 fn default() -> Self {
9146 Self::DEFAULT.clone()
9147 }
9148}
9149impl MessageData for COMMAND_CANCEL_DATA {
9150 type Message = MavMessage;
9151 const ID: u32 = 80u32;
9152 const NAME: &'static str = "COMMAND_CANCEL";
9153 const EXTRA_CRC: u8 = 14u8;
9154 const ENCODED_LEN: usize = 4usize;
9155 fn deser(
9156 _version: MavlinkVersion,
9157 __input: &[u8],
9158 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9159 let avail_len = __input.len();
9160 let mut payload_buf = [0; Self::ENCODED_LEN];
9161 let mut buf = if avail_len < Self::ENCODED_LEN {
9162 payload_buf[0..avail_len].copy_from_slice(__input);
9163 Bytes::new(&payload_buf)
9164 } else {
9165 Bytes::new(__input)
9166 };
9167 let mut __struct = Self::default();
9168 let tmp = buf.get_u16_le();
9169 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9170 ::mavlink_core::error::ParserError::InvalidEnum {
9171 enum_type: "MavCmd",
9172 value: tmp as u32,
9173 },
9174 )?;
9175 __struct.target_system = buf.get_u8();
9176 __struct.target_component = buf.get_u8();
9177 Ok(__struct)
9178 }
9179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9180 let mut __tmp = BytesMut::new(bytes);
9181 #[allow(clippy::absurd_extreme_comparisons)]
9182 #[allow(unused_comparisons)]
9183 if __tmp.remaining() < Self::ENCODED_LEN {
9184 panic!(
9185 "buffer is too small (need {} bytes, but got {})",
9186 Self::ENCODED_LEN,
9187 __tmp.remaining(),
9188 )
9189 }
9190 __tmp.put_u16_le(self.command as u16);
9191 __tmp.put_u8(self.target_system);
9192 __tmp.put_u8(self.target_component);
9193 if matches!(version, MavlinkVersion::V2) {
9194 let len = __tmp.len();
9195 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9196 } else {
9197 __tmp.len()
9198 }
9199 }
9200}
9201#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9202#[doc = ""]
9203#[doc = "ID: 75"]
9204#[derive(Debug, Clone, PartialEq)]
9205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9207#[cfg_attr(feature = "ts", derive(TS))]
9208#[cfg_attr(feature = "ts", ts(export))]
9209pub struct COMMAND_INT_DATA {
9210 #[doc = "PARAM1, see MAV_CMD enum"]
9211 pub param1: f32,
9212 #[doc = "PARAM2, see MAV_CMD enum"]
9213 pub param2: f32,
9214 #[doc = "PARAM3, see MAV_CMD enum"]
9215 pub param3: f32,
9216 #[doc = "PARAM4, see MAV_CMD enum"]
9217 pub param4: f32,
9218 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9219 pub x: i32,
9220 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9221 pub y: i32,
9222 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9223 pub z: f32,
9224 #[doc = "The scheduled action for the mission item."]
9225 pub command: MavCmd,
9226 #[doc = "System ID"]
9227 pub target_system: u8,
9228 #[doc = "Component ID"]
9229 pub target_component: u8,
9230 #[doc = "The coordinate system of the COMMAND."]
9231 pub frame: MavFrame,
9232 #[doc = "Not used."]
9233 pub current: u8,
9234 #[doc = "Not used (set 0)."]
9235 pub autocontinue: u8,
9236}
9237impl COMMAND_INT_DATA {
9238 pub const ENCODED_LEN: usize = 35usize;
9239 pub const DEFAULT: Self = Self {
9240 param1: 0.0_f32,
9241 param2: 0.0_f32,
9242 param3: 0.0_f32,
9243 param4: 0.0_f32,
9244 x: 0_i32,
9245 y: 0_i32,
9246 z: 0.0_f32,
9247 command: MavCmd::DEFAULT,
9248 target_system: 0_u8,
9249 target_component: 0_u8,
9250 frame: MavFrame::DEFAULT,
9251 current: 0_u8,
9252 autocontinue: 0_u8,
9253 };
9254 #[cfg(feature = "arbitrary")]
9255 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9256 use arbitrary::{Arbitrary, Unstructured};
9257 let mut buf = [0u8; 1024];
9258 rng.fill_bytes(&mut buf);
9259 let mut unstructured = Unstructured::new(&buf);
9260 Self::arbitrary(&mut unstructured).unwrap_or_default()
9261 }
9262}
9263impl Default for COMMAND_INT_DATA {
9264 fn default() -> Self {
9265 Self::DEFAULT.clone()
9266 }
9267}
9268impl MessageData for COMMAND_INT_DATA {
9269 type Message = MavMessage;
9270 const ID: u32 = 75u32;
9271 const NAME: &'static str = "COMMAND_INT";
9272 const EXTRA_CRC: u8 = 158u8;
9273 const ENCODED_LEN: usize = 35usize;
9274 fn deser(
9275 _version: MavlinkVersion,
9276 __input: &[u8],
9277 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9278 let avail_len = __input.len();
9279 let mut payload_buf = [0; Self::ENCODED_LEN];
9280 let mut buf = if avail_len < Self::ENCODED_LEN {
9281 payload_buf[0..avail_len].copy_from_slice(__input);
9282 Bytes::new(&payload_buf)
9283 } else {
9284 Bytes::new(__input)
9285 };
9286 let mut __struct = Self::default();
9287 __struct.param1 = buf.get_f32_le();
9288 __struct.param2 = buf.get_f32_le();
9289 __struct.param3 = buf.get_f32_le();
9290 __struct.param4 = buf.get_f32_le();
9291 __struct.x = buf.get_i32_le();
9292 __struct.y = buf.get_i32_le();
9293 __struct.z = buf.get_f32_le();
9294 let tmp = buf.get_u16_le();
9295 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9296 ::mavlink_core::error::ParserError::InvalidEnum {
9297 enum_type: "MavCmd",
9298 value: tmp as u32,
9299 },
9300 )?;
9301 __struct.target_system = buf.get_u8();
9302 __struct.target_component = buf.get_u8();
9303 let tmp = buf.get_u8();
9304 __struct.frame =
9305 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9306 enum_type: "MavFrame",
9307 value: tmp as u32,
9308 })?;
9309 __struct.current = buf.get_u8();
9310 __struct.autocontinue = buf.get_u8();
9311 Ok(__struct)
9312 }
9313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9314 let mut __tmp = BytesMut::new(bytes);
9315 #[allow(clippy::absurd_extreme_comparisons)]
9316 #[allow(unused_comparisons)]
9317 if __tmp.remaining() < Self::ENCODED_LEN {
9318 panic!(
9319 "buffer is too small (need {} bytes, but got {})",
9320 Self::ENCODED_LEN,
9321 __tmp.remaining(),
9322 )
9323 }
9324 __tmp.put_f32_le(self.param1);
9325 __tmp.put_f32_le(self.param2);
9326 __tmp.put_f32_le(self.param3);
9327 __tmp.put_f32_le(self.param4);
9328 __tmp.put_i32_le(self.x);
9329 __tmp.put_i32_le(self.y);
9330 __tmp.put_f32_le(self.z);
9331 __tmp.put_u16_le(self.command as u16);
9332 __tmp.put_u8(self.target_system);
9333 __tmp.put_u8(self.target_component);
9334 __tmp.put_u8(self.frame as u8);
9335 __tmp.put_u8(self.current);
9336 __tmp.put_u8(self.autocontinue);
9337 if matches!(version, MavlinkVersion::V2) {
9338 let len = __tmp.len();
9339 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9340 } else {
9341 __tmp.len()
9342 }
9343 }
9344}
9345#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9346#[doc = ""]
9347#[doc = "ID: 76"]
9348#[derive(Debug, Clone, PartialEq)]
9349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9350#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9351#[cfg_attr(feature = "ts", derive(TS))]
9352#[cfg_attr(feature = "ts", ts(export))]
9353pub struct COMMAND_LONG_DATA {
9354 #[doc = "Parameter 1 (for the specific command)."]
9355 pub param1: f32,
9356 #[doc = "Parameter 2 (for the specific command)."]
9357 pub param2: f32,
9358 #[doc = "Parameter 3 (for the specific command)."]
9359 pub param3: f32,
9360 #[doc = "Parameter 4 (for the specific command)."]
9361 pub param4: f32,
9362 #[doc = "Parameter 5 (for the specific command)."]
9363 pub param5: f32,
9364 #[doc = "Parameter 6 (for the specific command)."]
9365 pub param6: f32,
9366 #[doc = "Parameter 7 (for the specific command)."]
9367 pub param7: f32,
9368 #[doc = "Command ID (of command to send)."]
9369 pub command: MavCmd,
9370 #[doc = "System which should execute the command"]
9371 pub target_system: u8,
9372 #[doc = "Component which should execute the command, 0 for all components"]
9373 pub target_component: u8,
9374 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9375 pub confirmation: u8,
9376}
9377impl COMMAND_LONG_DATA {
9378 pub const ENCODED_LEN: usize = 33usize;
9379 pub const DEFAULT: Self = Self {
9380 param1: 0.0_f32,
9381 param2: 0.0_f32,
9382 param3: 0.0_f32,
9383 param4: 0.0_f32,
9384 param5: 0.0_f32,
9385 param6: 0.0_f32,
9386 param7: 0.0_f32,
9387 command: MavCmd::DEFAULT,
9388 target_system: 0_u8,
9389 target_component: 0_u8,
9390 confirmation: 0_u8,
9391 };
9392 #[cfg(feature = "arbitrary")]
9393 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9394 use arbitrary::{Arbitrary, Unstructured};
9395 let mut buf = [0u8; 1024];
9396 rng.fill_bytes(&mut buf);
9397 let mut unstructured = Unstructured::new(&buf);
9398 Self::arbitrary(&mut unstructured).unwrap_or_default()
9399 }
9400}
9401impl Default for COMMAND_LONG_DATA {
9402 fn default() -> Self {
9403 Self::DEFAULT.clone()
9404 }
9405}
9406impl MessageData for COMMAND_LONG_DATA {
9407 type Message = MavMessage;
9408 const ID: u32 = 76u32;
9409 const NAME: &'static str = "COMMAND_LONG";
9410 const EXTRA_CRC: u8 = 152u8;
9411 const ENCODED_LEN: usize = 33usize;
9412 fn deser(
9413 _version: MavlinkVersion,
9414 __input: &[u8],
9415 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9416 let avail_len = __input.len();
9417 let mut payload_buf = [0; Self::ENCODED_LEN];
9418 let mut buf = if avail_len < Self::ENCODED_LEN {
9419 payload_buf[0..avail_len].copy_from_slice(__input);
9420 Bytes::new(&payload_buf)
9421 } else {
9422 Bytes::new(__input)
9423 };
9424 let mut __struct = Self::default();
9425 __struct.param1 = buf.get_f32_le();
9426 __struct.param2 = buf.get_f32_le();
9427 __struct.param3 = buf.get_f32_le();
9428 __struct.param4 = buf.get_f32_le();
9429 __struct.param5 = buf.get_f32_le();
9430 __struct.param6 = buf.get_f32_le();
9431 __struct.param7 = buf.get_f32_le();
9432 let tmp = buf.get_u16_le();
9433 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9434 ::mavlink_core::error::ParserError::InvalidEnum {
9435 enum_type: "MavCmd",
9436 value: tmp as u32,
9437 },
9438 )?;
9439 __struct.target_system = buf.get_u8();
9440 __struct.target_component = buf.get_u8();
9441 __struct.confirmation = buf.get_u8();
9442 Ok(__struct)
9443 }
9444 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9445 let mut __tmp = BytesMut::new(bytes);
9446 #[allow(clippy::absurd_extreme_comparisons)]
9447 #[allow(unused_comparisons)]
9448 if __tmp.remaining() < Self::ENCODED_LEN {
9449 panic!(
9450 "buffer is too small (need {} bytes, but got {})",
9451 Self::ENCODED_LEN,
9452 __tmp.remaining(),
9453 )
9454 }
9455 __tmp.put_f32_le(self.param1);
9456 __tmp.put_f32_le(self.param2);
9457 __tmp.put_f32_le(self.param3);
9458 __tmp.put_f32_le(self.param4);
9459 __tmp.put_f32_le(self.param5);
9460 __tmp.put_f32_le(self.param6);
9461 __tmp.put_f32_le(self.param7);
9462 __tmp.put_u16_le(self.command as u16);
9463 __tmp.put_u8(self.target_system);
9464 __tmp.put_u8(self.target_component);
9465 __tmp.put_u8(self.confirmation);
9466 if matches!(version, MavlinkVersion::V2) {
9467 let len = __tmp.len();
9468 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9469 } else {
9470 __tmp.len()
9471 }
9472 }
9473}
9474#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9475#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9476#[doc = ""]
9477#[doc = "ID: 395"]
9478#[derive(Debug, Clone, PartialEq)]
9479#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9481#[cfg_attr(feature = "ts", derive(TS))]
9482#[cfg_attr(feature = "ts", ts(export))]
9483pub struct COMPONENT_INFORMATION_DATA {
9484 #[doc = "Timestamp (time since system boot)."]
9485 pub time_boot_ms: u32,
9486 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9487 pub general_metadata_file_crc: u32,
9488 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9489 pub peripherals_metadata_file_crc: u32,
9490 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9491 #[cfg_attr(
9492 feature = "serde",
9493 serde(
9494 serialize_with = "crate::nulstr::serialize::<_, 100>",
9495 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
9496 )
9497 )]
9498 #[cfg_attr(feature = "ts", ts(type = "string"))]
9499 pub general_metadata_uri: [u8; 100],
9500 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9501 #[cfg_attr(
9502 feature = "serde",
9503 serde(
9504 serialize_with = "crate::nulstr::serialize::<_, 100>",
9505 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
9506 )
9507 )]
9508 #[cfg_attr(feature = "ts", ts(type = "string"))]
9509 pub peripherals_metadata_uri: [u8; 100],
9510}
9511impl COMPONENT_INFORMATION_DATA {
9512 pub const ENCODED_LEN: usize = 212usize;
9513 pub const DEFAULT: Self = Self {
9514 time_boot_ms: 0_u32,
9515 general_metadata_file_crc: 0_u32,
9516 peripherals_metadata_file_crc: 0_u32,
9517 general_metadata_uri: [0_u8; 100usize],
9518 peripherals_metadata_uri: [0_u8; 100usize],
9519 };
9520 #[cfg(feature = "arbitrary")]
9521 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9522 use arbitrary::{Arbitrary, Unstructured};
9523 let mut buf = [0u8; 1024];
9524 rng.fill_bytes(&mut buf);
9525 let mut unstructured = Unstructured::new(&buf);
9526 Self::arbitrary(&mut unstructured).unwrap_or_default()
9527 }
9528}
9529impl Default for COMPONENT_INFORMATION_DATA {
9530 fn default() -> Self {
9531 Self::DEFAULT.clone()
9532 }
9533}
9534impl MessageData for COMPONENT_INFORMATION_DATA {
9535 type Message = MavMessage;
9536 const ID: u32 = 395u32;
9537 const NAME: &'static str = "COMPONENT_INFORMATION";
9538 const EXTRA_CRC: u8 = 0u8;
9539 const ENCODED_LEN: usize = 212usize;
9540 fn deser(
9541 _version: MavlinkVersion,
9542 __input: &[u8],
9543 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9544 let avail_len = __input.len();
9545 let mut payload_buf = [0; Self::ENCODED_LEN];
9546 let mut buf = if avail_len < Self::ENCODED_LEN {
9547 payload_buf[0..avail_len].copy_from_slice(__input);
9548 Bytes::new(&payload_buf)
9549 } else {
9550 Bytes::new(__input)
9551 };
9552 let mut __struct = Self::default();
9553 __struct.time_boot_ms = buf.get_u32_le();
9554 __struct.general_metadata_file_crc = buf.get_u32_le();
9555 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9556 for v in &mut __struct.general_metadata_uri {
9557 let val = buf.get_u8();
9558 *v = val;
9559 }
9560 for v in &mut __struct.peripherals_metadata_uri {
9561 let val = buf.get_u8();
9562 *v = val;
9563 }
9564 Ok(__struct)
9565 }
9566 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9567 let mut __tmp = BytesMut::new(bytes);
9568 #[allow(clippy::absurd_extreme_comparisons)]
9569 #[allow(unused_comparisons)]
9570 if __tmp.remaining() < Self::ENCODED_LEN {
9571 panic!(
9572 "buffer is too small (need {} bytes, but got {})",
9573 Self::ENCODED_LEN,
9574 __tmp.remaining(),
9575 )
9576 }
9577 __tmp.put_u32_le(self.time_boot_ms);
9578 __tmp.put_u32_le(self.general_metadata_file_crc);
9579 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9580 for val in &self.general_metadata_uri {
9581 __tmp.put_u8(*val);
9582 }
9583 for val in &self.peripherals_metadata_uri {
9584 __tmp.put_u8(*val);
9585 }
9586 if matches!(version, MavlinkVersion::V2) {
9587 let len = __tmp.len();
9588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9589 } else {
9590 __tmp.len()
9591 }
9592 }
9593}
9594#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9595#[doc = ""]
9596#[doc = "ID: 396"]
9597#[derive(Debug, Clone, PartialEq)]
9598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9600#[cfg_attr(feature = "ts", derive(TS))]
9601#[cfg_attr(feature = "ts", ts(export))]
9602pub struct COMPONENT_INFORMATION_BASIC_DATA {
9603 #[doc = "Component capability flags"]
9604 pub capabilities: MavProtocolCapability,
9605 #[doc = "Timestamp (time since system boot)."]
9606 pub time_boot_ms: u32,
9607 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9608 pub time_manufacture_s: u32,
9609 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9610 #[cfg_attr(
9611 feature = "serde",
9612 serde(
9613 serialize_with = "crate::nulstr::serialize::<_, 32>",
9614 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
9615 )
9616 )]
9617 #[cfg_attr(feature = "ts", ts(type = "string"))]
9618 pub vendor_name: [u8; 32],
9619 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9620 #[cfg_attr(
9621 feature = "serde",
9622 serde(
9623 serialize_with = "crate::nulstr::serialize::<_, 32>",
9624 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
9625 )
9626 )]
9627 #[cfg_attr(feature = "ts", ts(type = "string"))]
9628 pub model_name: [u8; 32],
9629 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9630 #[cfg_attr(
9631 feature = "serde",
9632 serde(
9633 serialize_with = "crate::nulstr::serialize::<_, 24>",
9634 deserialize_with = "crate::nulstr::deserialize::<_, 24>"
9635 )
9636 )]
9637 #[cfg_attr(feature = "ts", ts(type = "string"))]
9638 pub software_version: [u8; 24],
9639 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9640 #[cfg_attr(
9641 feature = "serde",
9642 serde(
9643 serialize_with = "crate::nulstr::serialize::<_, 24>",
9644 deserialize_with = "crate::nulstr::deserialize::<_, 24>"
9645 )
9646 )]
9647 #[cfg_attr(feature = "ts", ts(type = "string"))]
9648 pub hardware_version: [u8; 24],
9649 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9650 #[cfg_attr(
9651 feature = "serde",
9652 serde(
9653 serialize_with = "crate::nulstr::serialize::<_, 32>",
9654 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
9655 )
9656 )]
9657 #[cfg_attr(feature = "ts", ts(type = "string"))]
9658 pub serial_number: [u8; 32],
9659}
9660impl COMPONENT_INFORMATION_BASIC_DATA {
9661 pub const ENCODED_LEN: usize = 160usize;
9662 pub const DEFAULT: Self = Self {
9663 capabilities: MavProtocolCapability::DEFAULT,
9664 time_boot_ms: 0_u32,
9665 time_manufacture_s: 0_u32,
9666 vendor_name: [0_u8; 32usize],
9667 model_name: [0_u8; 32usize],
9668 software_version: [0_u8; 24usize],
9669 hardware_version: [0_u8; 24usize],
9670 serial_number: [0_u8; 32usize],
9671 };
9672 #[cfg(feature = "arbitrary")]
9673 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9674 use arbitrary::{Arbitrary, Unstructured};
9675 let mut buf = [0u8; 1024];
9676 rng.fill_bytes(&mut buf);
9677 let mut unstructured = Unstructured::new(&buf);
9678 Self::arbitrary(&mut unstructured).unwrap_or_default()
9679 }
9680}
9681impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9682 fn default() -> Self {
9683 Self::DEFAULT.clone()
9684 }
9685}
9686impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9687 type Message = MavMessage;
9688 const ID: u32 = 396u32;
9689 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9690 const EXTRA_CRC: u8 = 50u8;
9691 const ENCODED_LEN: usize = 160usize;
9692 fn deser(
9693 _version: MavlinkVersion,
9694 __input: &[u8],
9695 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9696 let avail_len = __input.len();
9697 let mut payload_buf = [0; Self::ENCODED_LEN];
9698 let mut buf = if avail_len < Self::ENCODED_LEN {
9699 payload_buf[0..avail_len].copy_from_slice(__input);
9700 Bytes::new(&payload_buf)
9701 } else {
9702 Bytes::new(__input)
9703 };
9704 let mut __struct = Self::default();
9705 let tmp = buf.get_u64_le();
9706 __struct.capabilities = MavProtocolCapability::from_bits(
9707 tmp & MavProtocolCapability::all().bits(),
9708 )
9709 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9710 flag_type: "MavProtocolCapability",
9711 value: tmp as u32,
9712 })?;
9713 __struct.time_boot_ms = buf.get_u32_le();
9714 __struct.time_manufacture_s = buf.get_u32_le();
9715 for v in &mut __struct.vendor_name {
9716 let val = buf.get_u8();
9717 *v = val;
9718 }
9719 for v in &mut __struct.model_name {
9720 let val = buf.get_u8();
9721 *v = val;
9722 }
9723 for v in &mut __struct.software_version {
9724 let val = buf.get_u8();
9725 *v = val;
9726 }
9727 for v in &mut __struct.hardware_version {
9728 let val = buf.get_u8();
9729 *v = val;
9730 }
9731 for v in &mut __struct.serial_number {
9732 let val = buf.get_u8();
9733 *v = val;
9734 }
9735 Ok(__struct)
9736 }
9737 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9738 let mut __tmp = BytesMut::new(bytes);
9739 #[allow(clippy::absurd_extreme_comparisons)]
9740 #[allow(unused_comparisons)]
9741 if __tmp.remaining() < Self::ENCODED_LEN {
9742 panic!(
9743 "buffer is too small (need {} bytes, but got {})",
9744 Self::ENCODED_LEN,
9745 __tmp.remaining(),
9746 )
9747 }
9748 __tmp.put_u64_le(self.capabilities.bits());
9749 __tmp.put_u32_le(self.time_boot_ms);
9750 __tmp.put_u32_le(self.time_manufacture_s);
9751 for val in &self.vendor_name {
9752 __tmp.put_u8(*val);
9753 }
9754 for val in &self.model_name {
9755 __tmp.put_u8(*val);
9756 }
9757 for val in &self.software_version {
9758 __tmp.put_u8(*val);
9759 }
9760 for val in &self.hardware_version {
9761 __tmp.put_u8(*val);
9762 }
9763 for val in &self.serial_number {
9764 __tmp.put_u8(*val);
9765 }
9766 if matches!(version, MavlinkVersion::V2) {
9767 let len = __tmp.len();
9768 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9769 } else {
9770 __tmp.len()
9771 }
9772 }
9773}
9774#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9775#[doc = ""]
9776#[doc = "ID: 397"]
9777#[derive(Debug, Clone, PartialEq)]
9778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9780#[cfg_attr(feature = "ts", derive(TS))]
9781#[cfg_attr(feature = "ts", ts(export))]
9782pub struct COMPONENT_METADATA_DATA {
9783 #[doc = "Timestamp (time since system boot)."]
9784 pub time_boot_ms: u32,
9785 #[doc = "CRC32 of the general metadata file."]
9786 pub file_crc: u32,
9787 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9788 #[cfg_attr(
9789 feature = "serde",
9790 serde(
9791 serialize_with = "crate::nulstr::serialize::<_, 100>",
9792 deserialize_with = "crate::nulstr::deserialize::<_, 100>"
9793 )
9794 )]
9795 #[cfg_attr(feature = "ts", ts(type = "string"))]
9796 pub uri: [u8; 100],
9797}
9798impl COMPONENT_METADATA_DATA {
9799 pub const ENCODED_LEN: usize = 108usize;
9800 pub const DEFAULT: Self = Self {
9801 time_boot_ms: 0_u32,
9802 file_crc: 0_u32,
9803 uri: [0_u8; 100usize],
9804 };
9805 #[cfg(feature = "arbitrary")]
9806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9807 use arbitrary::{Arbitrary, Unstructured};
9808 let mut buf = [0u8; 1024];
9809 rng.fill_bytes(&mut buf);
9810 let mut unstructured = Unstructured::new(&buf);
9811 Self::arbitrary(&mut unstructured).unwrap_or_default()
9812 }
9813}
9814impl Default for COMPONENT_METADATA_DATA {
9815 fn default() -> Self {
9816 Self::DEFAULT.clone()
9817 }
9818}
9819impl MessageData for COMPONENT_METADATA_DATA {
9820 type Message = MavMessage;
9821 const ID: u32 = 397u32;
9822 const NAME: &'static str = "COMPONENT_METADATA";
9823 const EXTRA_CRC: u8 = 182u8;
9824 const ENCODED_LEN: usize = 108usize;
9825 fn deser(
9826 _version: MavlinkVersion,
9827 __input: &[u8],
9828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9829 let avail_len = __input.len();
9830 let mut payload_buf = [0; Self::ENCODED_LEN];
9831 let mut buf = if avail_len < Self::ENCODED_LEN {
9832 payload_buf[0..avail_len].copy_from_slice(__input);
9833 Bytes::new(&payload_buf)
9834 } else {
9835 Bytes::new(__input)
9836 };
9837 let mut __struct = Self::default();
9838 __struct.time_boot_ms = buf.get_u32_le();
9839 __struct.file_crc = buf.get_u32_le();
9840 for v in &mut __struct.uri {
9841 let val = buf.get_u8();
9842 *v = val;
9843 }
9844 Ok(__struct)
9845 }
9846 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9847 let mut __tmp = BytesMut::new(bytes);
9848 #[allow(clippy::absurd_extreme_comparisons)]
9849 #[allow(unused_comparisons)]
9850 if __tmp.remaining() < Self::ENCODED_LEN {
9851 panic!(
9852 "buffer is too small (need {} bytes, but got {})",
9853 Self::ENCODED_LEN,
9854 __tmp.remaining(),
9855 )
9856 }
9857 __tmp.put_u32_le(self.time_boot_ms);
9858 __tmp.put_u32_le(self.file_crc);
9859 for val in &self.uri {
9860 __tmp.put_u8(*val);
9861 }
9862 if matches!(version, MavlinkVersion::V2) {
9863 let len = __tmp.len();
9864 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9865 } else {
9866 __tmp.len()
9867 }
9868 }
9869}
9870#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9871#[doc = ""]
9872#[doc = "ID: 146"]
9873#[derive(Debug, Clone, PartialEq)]
9874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9875#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9876#[cfg_attr(feature = "ts", derive(TS))]
9877#[cfg_attr(feature = "ts", ts(export))]
9878pub struct CONTROL_SYSTEM_STATE_DATA {
9879 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9880 pub time_usec: u64,
9881 #[doc = "X acceleration in body frame"]
9882 pub x_acc: f32,
9883 #[doc = "Y acceleration in body frame"]
9884 pub y_acc: f32,
9885 #[doc = "Z acceleration in body frame"]
9886 pub z_acc: f32,
9887 #[doc = "X velocity in body frame"]
9888 pub x_vel: f32,
9889 #[doc = "Y velocity in body frame"]
9890 pub y_vel: f32,
9891 #[doc = "Z velocity in body frame"]
9892 pub z_vel: f32,
9893 #[doc = "X position in local frame"]
9894 pub x_pos: f32,
9895 #[doc = "Y position in local frame"]
9896 pub y_pos: f32,
9897 #[doc = "Z position in local frame"]
9898 pub z_pos: f32,
9899 #[doc = "Airspeed, set to -1 if unknown"]
9900 pub airspeed: f32,
9901 #[doc = "Variance of body velocity estimate"]
9902 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9903 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9904 pub vel_variance: [f32; 3],
9905 #[doc = "Variance in local position"]
9906 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9907 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9908 pub pos_variance: [f32; 3],
9909 #[doc = "The attitude, represented as Quaternion"]
9910 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9911 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9912 pub q: [f32; 4],
9913 #[doc = "Angular rate in roll axis"]
9914 pub roll_rate: f32,
9915 #[doc = "Angular rate in pitch axis"]
9916 pub pitch_rate: f32,
9917 #[doc = "Angular rate in yaw axis"]
9918 pub yaw_rate: f32,
9919}
9920impl CONTROL_SYSTEM_STATE_DATA {
9921 pub const ENCODED_LEN: usize = 100usize;
9922 pub const DEFAULT: Self = Self {
9923 time_usec: 0_u64,
9924 x_acc: 0.0_f32,
9925 y_acc: 0.0_f32,
9926 z_acc: 0.0_f32,
9927 x_vel: 0.0_f32,
9928 y_vel: 0.0_f32,
9929 z_vel: 0.0_f32,
9930 x_pos: 0.0_f32,
9931 y_pos: 0.0_f32,
9932 z_pos: 0.0_f32,
9933 airspeed: 0.0_f32,
9934 vel_variance: [0.0_f32; 3usize],
9935 pos_variance: [0.0_f32; 3usize],
9936 q: [0.0_f32; 4usize],
9937 roll_rate: 0.0_f32,
9938 pitch_rate: 0.0_f32,
9939 yaw_rate: 0.0_f32,
9940 };
9941 #[cfg(feature = "arbitrary")]
9942 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9943 use arbitrary::{Arbitrary, Unstructured};
9944 let mut buf = [0u8; 1024];
9945 rng.fill_bytes(&mut buf);
9946 let mut unstructured = Unstructured::new(&buf);
9947 Self::arbitrary(&mut unstructured).unwrap_or_default()
9948 }
9949}
9950impl Default for CONTROL_SYSTEM_STATE_DATA {
9951 fn default() -> Self {
9952 Self::DEFAULT.clone()
9953 }
9954}
9955impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9956 type Message = MavMessage;
9957 const ID: u32 = 146u32;
9958 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9959 const EXTRA_CRC: u8 = 103u8;
9960 const ENCODED_LEN: usize = 100usize;
9961 fn deser(
9962 _version: MavlinkVersion,
9963 __input: &[u8],
9964 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9965 let avail_len = __input.len();
9966 let mut payload_buf = [0; Self::ENCODED_LEN];
9967 let mut buf = if avail_len < Self::ENCODED_LEN {
9968 payload_buf[0..avail_len].copy_from_slice(__input);
9969 Bytes::new(&payload_buf)
9970 } else {
9971 Bytes::new(__input)
9972 };
9973 let mut __struct = Self::default();
9974 __struct.time_usec = buf.get_u64_le();
9975 __struct.x_acc = buf.get_f32_le();
9976 __struct.y_acc = buf.get_f32_le();
9977 __struct.z_acc = buf.get_f32_le();
9978 __struct.x_vel = buf.get_f32_le();
9979 __struct.y_vel = buf.get_f32_le();
9980 __struct.z_vel = buf.get_f32_le();
9981 __struct.x_pos = buf.get_f32_le();
9982 __struct.y_pos = buf.get_f32_le();
9983 __struct.z_pos = buf.get_f32_le();
9984 __struct.airspeed = buf.get_f32_le();
9985 for v in &mut __struct.vel_variance {
9986 let val = buf.get_f32_le();
9987 *v = val;
9988 }
9989 for v in &mut __struct.pos_variance {
9990 let val = buf.get_f32_le();
9991 *v = val;
9992 }
9993 for v in &mut __struct.q {
9994 let val = buf.get_f32_le();
9995 *v = val;
9996 }
9997 __struct.roll_rate = buf.get_f32_le();
9998 __struct.pitch_rate = buf.get_f32_le();
9999 __struct.yaw_rate = buf.get_f32_le();
10000 Ok(__struct)
10001 }
10002 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10003 let mut __tmp = BytesMut::new(bytes);
10004 #[allow(clippy::absurd_extreme_comparisons)]
10005 #[allow(unused_comparisons)]
10006 if __tmp.remaining() < Self::ENCODED_LEN {
10007 panic!(
10008 "buffer is too small (need {} bytes, but got {})",
10009 Self::ENCODED_LEN,
10010 __tmp.remaining(),
10011 )
10012 }
10013 __tmp.put_u64_le(self.time_usec);
10014 __tmp.put_f32_le(self.x_acc);
10015 __tmp.put_f32_le(self.y_acc);
10016 __tmp.put_f32_le(self.z_acc);
10017 __tmp.put_f32_le(self.x_vel);
10018 __tmp.put_f32_le(self.y_vel);
10019 __tmp.put_f32_le(self.z_vel);
10020 __tmp.put_f32_le(self.x_pos);
10021 __tmp.put_f32_le(self.y_pos);
10022 __tmp.put_f32_le(self.z_pos);
10023 __tmp.put_f32_le(self.airspeed);
10024 for val in &self.vel_variance {
10025 __tmp.put_f32_le(*val);
10026 }
10027 for val in &self.pos_variance {
10028 __tmp.put_f32_le(*val);
10029 }
10030 for val in &self.q {
10031 __tmp.put_f32_le(*val);
10032 }
10033 __tmp.put_f32_le(self.roll_rate);
10034 __tmp.put_f32_le(self.pitch_rate);
10035 __tmp.put_f32_le(self.yaw_rate);
10036 if matches!(version, MavlinkVersion::V2) {
10037 let len = __tmp.len();
10038 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10039 } else {
10040 __tmp.len()
10041 }
10042 }
10043}
10044#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10045#[doc = ""]
10046#[doc = "ID: 411"]
10047#[derive(Debug, Clone, PartialEq)]
10048#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10049#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10050#[cfg_attr(feature = "ts", derive(TS))]
10051#[cfg_attr(feature = "ts", ts(export))]
10052pub struct CURRENT_EVENT_SEQUENCE_DATA {
10053 #[doc = "Sequence number."]
10054 pub sequence: u16,
10055 #[doc = "Flag bitset."]
10056 pub flags: MavEventCurrentSequenceFlags,
10057}
10058impl CURRENT_EVENT_SEQUENCE_DATA {
10059 pub const ENCODED_LEN: usize = 3usize;
10060 pub const DEFAULT: Self = Self {
10061 sequence: 0_u16,
10062 flags: MavEventCurrentSequenceFlags::DEFAULT,
10063 };
10064 #[cfg(feature = "arbitrary")]
10065 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10066 use arbitrary::{Arbitrary, Unstructured};
10067 let mut buf = [0u8; 1024];
10068 rng.fill_bytes(&mut buf);
10069 let mut unstructured = Unstructured::new(&buf);
10070 Self::arbitrary(&mut unstructured).unwrap_or_default()
10071 }
10072}
10073impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10074 fn default() -> Self {
10075 Self::DEFAULT.clone()
10076 }
10077}
10078impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10079 type Message = MavMessage;
10080 const ID: u32 = 411u32;
10081 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10082 const EXTRA_CRC: u8 = 106u8;
10083 const ENCODED_LEN: usize = 3usize;
10084 fn deser(
10085 _version: MavlinkVersion,
10086 __input: &[u8],
10087 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10088 let avail_len = __input.len();
10089 let mut payload_buf = [0; Self::ENCODED_LEN];
10090 let mut buf = if avail_len < Self::ENCODED_LEN {
10091 payload_buf[0..avail_len].copy_from_slice(__input);
10092 Bytes::new(&payload_buf)
10093 } else {
10094 Bytes::new(__input)
10095 };
10096 let mut __struct = Self::default();
10097 __struct.sequence = buf.get_u16_le();
10098 let tmp = buf.get_u8();
10099 __struct.flags =
10100 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10101 enum_type: "MavEventCurrentSequenceFlags",
10102 value: tmp as u32,
10103 })?;
10104 Ok(__struct)
10105 }
10106 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10107 let mut __tmp = BytesMut::new(bytes);
10108 #[allow(clippy::absurd_extreme_comparisons)]
10109 #[allow(unused_comparisons)]
10110 if __tmp.remaining() < Self::ENCODED_LEN {
10111 panic!(
10112 "buffer is too small (need {} bytes, but got {})",
10113 Self::ENCODED_LEN,
10114 __tmp.remaining(),
10115 )
10116 }
10117 __tmp.put_u16_le(self.sequence);
10118 __tmp.put_u8(self.flags as u8);
10119 if matches!(version, MavlinkVersion::V2) {
10120 let len = __tmp.len();
10121 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10122 } else {
10123 __tmp.len()
10124 }
10125 }
10126}
10127#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10128#[doc = ""]
10129#[doc = "ID: 436"]
10130#[derive(Debug, Clone, PartialEq)]
10131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10133#[cfg_attr(feature = "ts", derive(TS))]
10134#[cfg_attr(feature = "ts", ts(export))]
10135pub struct CURRENT_MODE_DATA {
10136 #[doc = "A bitfield for use for autopilot-specific flags"]
10137 pub custom_mode: u32,
10138 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10139 pub intended_custom_mode: u32,
10140 #[doc = "Standard mode."]
10141 pub standard_mode: MavStandardMode,
10142}
10143impl CURRENT_MODE_DATA {
10144 pub const ENCODED_LEN: usize = 9usize;
10145 pub const DEFAULT: Self = Self {
10146 custom_mode: 0_u32,
10147 intended_custom_mode: 0_u32,
10148 standard_mode: MavStandardMode::DEFAULT,
10149 };
10150 #[cfg(feature = "arbitrary")]
10151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10152 use arbitrary::{Arbitrary, Unstructured};
10153 let mut buf = [0u8; 1024];
10154 rng.fill_bytes(&mut buf);
10155 let mut unstructured = Unstructured::new(&buf);
10156 Self::arbitrary(&mut unstructured).unwrap_or_default()
10157 }
10158}
10159impl Default for CURRENT_MODE_DATA {
10160 fn default() -> Self {
10161 Self::DEFAULT.clone()
10162 }
10163}
10164impl MessageData for CURRENT_MODE_DATA {
10165 type Message = MavMessage;
10166 const ID: u32 = 436u32;
10167 const NAME: &'static str = "CURRENT_MODE";
10168 const EXTRA_CRC: u8 = 193u8;
10169 const ENCODED_LEN: usize = 9usize;
10170 fn deser(
10171 _version: MavlinkVersion,
10172 __input: &[u8],
10173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10174 let avail_len = __input.len();
10175 let mut payload_buf = [0; Self::ENCODED_LEN];
10176 let mut buf = if avail_len < Self::ENCODED_LEN {
10177 payload_buf[0..avail_len].copy_from_slice(__input);
10178 Bytes::new(&payload_buf)
10179 } else {
10180 Bytes::new(__input)
10181 };
10182 let mut __struct = Self::default();
10183 __struct.custom_mode = buf.get_u32_le();
10184 __struct.intended_custom_mode = buf.get_u32_le();
10185 let tmp = buf.get_u8();
10186 __struct.standard_mode =
10187 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10188 enum_type: "MavStandardMode",
10189 value: tmp as u32,
10190 })?;
10191 Ok(__struct)
10192 }
10193 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10194 let mut __tmp = BytesMut::new(bytes);
10195 #[allow(clippy::absurd_extreme_comparisons)]
10196 #[allow(unused_comparisons)]
10197 if __tmp.remaining() < Self::ENCODED_LEN {
10198 panic!(
10199 "buffer is too small (need {} bytes, but got {})",
10200 Self::ENCODED_LEN,
10201 __tmp.remaining(),
10202 )
10203 }
10204 __tmp.put_u32_le(self.custom_mode);
10205 __tmp.put_u32_le(self.intended_custom_mode);
10206 __tmp.put_u8(self.standard_mode as u8);
10207 if matches!(version, MavlinkVersion::V2) {
10208 let len = __tmp.len();
10209 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10210 } else {
10211 __tmp.len()
10212 }
10213 }
10214}
10215#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10216#[doc = "Data stream status information."]
10217#[doc = ""]
10218#[doc = "ID: 67"]
10219#[derive(Debug, Clone, PartialEq)]
10220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10221#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10222#[cfg_attr(feature = "ts", derive(TS))]
10223#[cfg_attr(feature = "ts", ts(export))]
10224pub struct DATA_STREAM_DATA {
10225 #[doc = "The message rate"]
10226 pub message_rate: u16,
10227 #[doc = "The ID of the requested data stream"]
10228 pub stream_id: u8,
10229 #[doc = "1 stream is enabled, 0 stream is stopped."]
10230 pub on_off: u8,
10231}
10232impl DATA_STREAM_DATA {
10233 pub const ENCODED_LEN: usize = 4usize;
10234 pub const DEFAULT: Self = Self {
10235 message_rate: 0_u16,
10236 stream_id: 0_u8,
10237 on_off: 0_u8,
10238 };
10239 #[cfg(feature = "arbitrary")]
10240 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10241 use arbitrary::{Arbitrary, Unstructured};
10242 let mut buf = [0u8; 1024];
10243 rng.fill_bytes(&mut buf);
10244 let mut unstructured = Unstructured::new(&buf);
10245 Self::arbitrary(&mut unstructured).unwrap_or_default()
10246 }
10247}
10248impl Default for DATA_STREAM_DATA {
10249 fn default() -> Self {
10250 Self::DEFAULT.clone()
10251 }
10252}
10253impl MessageData for DATA_STREAM_DATA {
10254 type Message = MavMessage;
10255 const ID: u32 = 67u32;
10256 const NAME: &'static str = "DATA_STREAM";
10257 const EXTRA_CRC: u8 = 21u8;
10258 const ENCODED_LEN: usize = 4usize;
10259 fn deser(
10260 _version: MavlinkVersion,
10261 __input: &[u8],
10262 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10263 let avail_len = __input.len();
10264 let mut payload_buf = [0; Self::ENCODED_LEN];
10265 let mut buf = if avail_len < Self::ENCODED_LEN {
10266 payload_buf[0..avail_len].copy_from_slice(__input);
10267 Bytes::new(&payload_buf)
10268 } else {
10269 Bytes::new(__input)
10270 };
10271 let mut __struct = Self::default();
10272 __struct.message_rate = buf.get_u16_le();
10273 __struct.stream_id = buf.get_u8();
10274 __struct.on_off = buf.get_u8();
10275 Ok(__struct)
10276 }
10277 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10278 let mut __tmp = BytesMut::new(bytes);
10279 #[allow(clippy::absurd_extreme_comparisons)]
10280 #[allow(unused_comparisons)]
10281 if __tmp.remaining() < Self::ENCODED_LEN {
10282 panic!(
10283 "buffer is too small (need {} bytes, but got {})",
10284 Self::ENCODED_LEN,
10285 __tmp.remaining(),
10286 )
10287 }
10288 __tmp.put_u16_le(self.message_rate);
10289 __tmp.put_u8(self.stream_id);
10290 __tmp.put_u8(self.on_off);
10291 if matches!(version, MavlinkVersion::V2) {
10292 let len = __tmp.len();
10293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10294 } else {
10295 __tmp.len()
10296 }
10297 }
10298}
10299#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10300#[doc = ""]
10301#[doc = "ID: 130"]
10302#[derive(Debug, Clone, PartialEq)]
10303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10305#[cfg_attr(feature = "ts", derive(TS))]
10306#[cfg_attr(feature = "ts", ts(export))]
10307pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10308 #[doc = "total data size (set on ACK only)."]
10309 pub size: u32,
10310 #[doc = "Width of a matrix or image."]
10311 pub width: u16,
10312 #[doc = "Height of a matrix or image."]
10313 pub height: u16,
10314 #[doc = "Number of packets being sent (set on ACK only)."]
10315 pub packets: u16,
10316 #[doc = "Type of requested/acknowledged data."]
10317 pub mavtype: MavlinkDataStreamType,
10318 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10319 pub payload: u8,
10320 #[doc = "JPEG quality. Values: [1-100]."]
10321 pub jpg_quality: u8,
10322}
10323impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10324 pub const ENCODED_LEN: usize = 13usize;
10325 pub const DEFAULT: Self = Self {
10326 size: 0_u32,
10327 width: 0_u16,
10328 height: 0_u16,
10329 packets: 0_u16,
10330 mavtype: MavlinkDataStreamType::DEFAULT,
10331 payload: 0_u8,
10332 jpg_quality: 0_u8,
10333 };
10334 #[cfg(feature = "arbitrary")]
10335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10336 use arbitrary::{Arbitrary, Unstructured};
10337 let mut buf = [0u8; 1024];
10338 rng.fill_bytes(&mut buf);
10339 let mut unstructured = Unstructured::new(&buf);
10340 Self::arbitrary(&mut unstructured).unwrap_or_default()
10341 }
10342}
10343impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10344 fn default() -> Self {
10345 Self::DEFAULT.clone()
10346 }
10347}
10348impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10349 type Message = MavMessage;
10350 const ID: u32 = 130u32;
10351 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10352 const EXTRA_CRC: u8 = 29u8;
10353 const ENCODED_LEN: usize = 13usize;
10354 fn deser(
10355 _version: MavlinkVersion,
10356 __input: &[u8],
10357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10358 let avail_len = __input.len();
10359 let mut payload_buf = [0; Self::ENCODED_LEN];
10360 let mut buf = if avail_len < Self::ENCODED_LEN {
10361 payload_buf[0..avail_len].copy_from_slice(__input);
10362 Bytes::new(&payload_buf)
10363 } else {
10364 Bytes::new(__input)
10365 };
10366 let mut __struct = Self::default();
10367 __struct.size = buf.get_u32_le();
10368 __struct.width = buf.get_u16_le();
10369 __struct.height = buf.get_u16_le();
10370 __struct.packets = buf.get_u16_le();
10371 let tmp = buf.get_u8();
10372 __struct.mavtype =
10373 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10374 enum_type: "MavlinkDataStreamType",
10375 value: tmp as u32,
10376 })?;
10377 __struct.payload = buf.get_u8();
10378 __struct.jpg_quality = buf.get_u8();
10379 Ok(__struct)
10380 }
10381 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10382 let mut __tmp = BytesMut::new(bytes);
10383 #[allow(clippy::absurd_extreme_comparisons)]
10384 #[allow(unused_comparisons)]
10385 if __tmp.remaining() < Self::ENCODED_LEN {
10386 panic!(
10387 "buffer is too small (need {} bytes, but got {})",
10388 Self::ENCODED_LEN,
10389 __tmp.remaining(),
10390 )
10391 }
10392 __tmp.put_u32_le(self.size);
10393 __tmp.put_u16_le(self.width);
10394 __tmp.put_u16_le(self.height);
10395 __tmp.put_u16_le(self.packets);
10396 __tmp.put_u8(self.mavtype as u8);
10397 __tmp.put_u8(self.payload);
10398 __tmp.put_u8(self.jpg_quality);
10399 if matches!(version, MavlinkVersion::V2) {
10400 let len = __tmp.len();
10401 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10402 } else {
10403 __tmp.len()
10404 }
10405 }
10406}
10407#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10408#[doc = ""]
10409#[doc = "ID: 254"]
10410#[derive(Debug, Clone, PartialEq)]
10411#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10412#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10413#[cfg_attr(feature = "ts", derive(TS))]
10414#[cfg_attr(feature = "ts", ts(export))]
10415pub struct DEBUG_DATA {
10416 #[doc = "Timestamp (time since system boot)."]
10417 pub time_boot_ms: u32,
10418 #[doc = "DEBUG value"]
10419 pub value: f32,
10420 #[doc = "index of debug variable"]
10421 pub ind: u8,
10422}
10423impl DEBUG_DATA {
10424 pub const ENCODED_LEN: usize = 9usize;
10425 pub const DEFAULT: Self = Self {
10426 time_boot_ms: 0_u32,
10427 value: 0.0_f32,
10428 ind: 0_u8,
10429 };
10430 #[cfg(feature = "arbitrary")]
10431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10432 use arbitrary::{Arbitrary, Unstructured};
10433 let mut buf = [0u8; 1024];
10434 rng.fill_bytes(&mut buf);
10435 let mut unstructured = Unstructured::new(&buf);
10436 Self::arbitrary(&mut unstructured).unwrap_or_default()
10437 }
10438}
10439impl Default for DEBUG_DATA {
10440 fn default() -> Self {
10441 Self::DEFAULT.clone()
10442 }
10443}
10444impl MessageData for DEBUG_DATA {
10445 type Message = MavMessage;
10446 const ID: u32 = 254u32;
10447 const NAME: &'static str = "DEBUG";
10448 const EXTRA_CRC: u8 = 46u8;
10449 const ENCODED_LEN: usize = 9usize;
10450 fn deser(
10451 _version: MavlinkVersion,
10452 __input: &[u8],
10453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10454 let avail_len = __input.len();
10455 let mut payload_buf = [0; Self::ENCODED_LEN];
10456 let mut buf = if avail_len < Self::ENCODED_LEN {
10457 payload_buf[0..avail_len].copy_from_slice(__input);
10458 Bytes::new(&payload_buf)
10459 } else {
10460 Bytes::new(__input)
10461 };
10462 let mut __struct = Self::default();
10463 __struct.time_boot_ms = buf.get_u32_le();
10464 __struct.value = buf.get_f32_le();
10465 __struct.ind = buf.get_u8();
10466 Ok(__struct)
10467 }
10468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10469 let mut __tmp = BytesMut::new(bytes);
10470 #[allow(clippy::absurd_extreme_comparisons)]
10471 #[allow(unused_comparisons)]
10472 if __tmp.remaining() < Self::ENCODED_LEN {
10473 panic!(
10474 "buffer is too small (need {} bytes, but got {})",
10475 Self::ENCODED_LEN,
10476 __tmp.remaining(),
10477 )
10478 }
10479 __tmp.put_u32_le(self.time_boot_ms);
10480 __tmp.put_f32_le(self.value);
10481 __tmp.put_u8(self.ind);
10482 if matches!(version, MavlinkVersion::V2) {
10483 let len = __tmp.len();
10484 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10485 } else {
10486 __tmp.len()
10487 }
10488 }
10489}
10490#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10491#[doc = ""]
10492#[doc = "ID: 350"]
10493#[derive(Debug, Clone, PartialEq)]
10494#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10495#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10496#[cfg_attr(feature = "ts", derive(TS))]
10497#[cfg_attr(feature = "ts", ts(export))]
10498pub struct DEBUG_FLOAT_ARRAY_DATA {
10499 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10500 pub time_usec: u64,
10501 #[doc = "Unique ID used to discriminate between arrays"]
10502 pub array_id: u16,
10503 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10504 #[cfg_attr(
10505 feature = "serde",
10506 serde(
10507 serialize_with = "crate::nulstr::serialize::<_, 10>",
10508 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
10509 )
10510 )]
10511 #[cfg_attr(feature = "ts", ts(type = "string"))]
10512 pub name: [u8; 10],
10513 #[doc = "data"]
10514 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10515 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10516 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10517 pub data: [f32; 58],
10518}
10519impl DEBUG_FLOAT_ARRAY_DATA {
10520 pub const ENCODED_LEN: usize = 252usize;
10521 pub const DEFAULT: Self = Self {
10522 time_usec: 0_u64,
10523 array_id: 0_u16,
10524 name: [0_u8; 10usize],
10525 data: [0.0_f32; 58usize],
10526 };
10527 #[cfg(feature = "arbitrary")]
10528 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10529 use arbitrary::{Arbitrary, Unstructured};
10530 let mut buf = [0u8; 1024];
10531 rng.fill_bytes(&mut buf);
10532 let mut unstructured = Unstructured::new(&buf);
10533 Self::arbitrary(&mut unstructured).unwrap_or_default()
10534 }
10535}
10536impl Default for DEBUG_FLOAT_ARRAY_DATA {
10537 fn default() -> Self {
10538 Self::DEFAULT.clone()
10539 }
10540}
10541impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10542 type Message = MavMessage;
10543 const ID: u32 = 350u32;
10544 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10545 const EXTRA_CRC: u8 = 232u8;
10546 const ENCODED_LEN: usize = 252usize;
10547 fn deser(
10548 _version: MavlinkVersion,
10549 __input: &[u8],
10550 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10551 let avail_len = __input.len();
10552 let mut payload_buf = [0; Self::ENCODED_LEN];
10553 let mut buf = if avail_len < Self::ENCODED_LEN {
10554 payload_buf[0..avail_len].copy_from_slice(__input);
10555 Bytes::new(&payload_buf)
10556 } else {
10557 Bytes::new(__input)
10558 };
10559 let mut __struct = Self::default();
10560 __struct.time_usec = buf.get_u64_le();
10561 __struct.array_id = buf.get_u16_le();
10562 for v in &mut __struct.name {
10563 let val = buf.get_u8();
10564 *v = val;
10565 }
10566 for v in &mut __struct.data {
10567 let val = buf.get_f32_le();
10568 *v = val;
10569 }
10570 Ok(__struct)
10571 }
10572 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10573 let mut __tmp = BytesMut::new(bytes);
10574 #[allow(clippy::absurd_extreme_comparisons)]
10575 #[allow(unused_comparisons)]
10576 if __tmp.remaining() < Self::ENCODED_LEN {
10577 panic!(
10578 "buffer is too small (need {} bytes, but got {})",
10579 Self::ENCODED_LEN,
10580 __tmp.remaining(),
10581 )
10582 }
10583 __tmp.put_u64_le(self.time_usec);
10584 __tmp.put_u16_le(self.array_id);
10585 for val in &self.name {
10586 __tmp.put_u8(*val);
10587 }
10588 if matches!(version, MavlinkVersion::V2) {
10589 for val in &self.data {
10590 __tmp.put_f32_le(*val);
10591 }
10592 let len = __tmp.len();
10593 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10594 } else {
10595 __tmp.len()
10596 }
10597 }
10598}
10599#[doc = "To debug something using a named 3D vector."]
10600#[doc = ""]
10601#[doc = "ID: 250"]
10602#[derive(Debug, Clone, PartialEq)]
10603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10605#[cfg_attr(feature = "ts", derive(TS))]
10606#[cfg_attr(feature = "ts", ts(export))]
10607pub struct DEBUG_VECT_DATA {
10608 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10609 pub time_usec: u64,
10610 #[doc = "x"]
10611 pub x: f32,
10612 #[doc = "y"]
10613 pub y: f32,
10614 #[doc = "z"]
10615 pub z: f32,
10616 #[doc = "Name"]
10617 #[cfg_attr(
10618 feature = "serde",
10619 serde(
10620 serialize_with = "crate::nulstr::serialize::<_, 10>",
10621 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
10622 )
10623 )]
10624 #[cfg_attr(feature = "ts", ts(type = "string"))]
10625 pub name: [u8; 10],
10626}
10627impl DEBUG_VECT_DATA {
10628 pub const ENCODED_LEN: usize = 30usize;
10629 pub const DEFAULT: Self = Self {
10630 time_usec: 0_u64,
10631 x: 0.0_f32,
10632 y: 0.0_f32,
10633 z: 0.0_f32,
10634 name: [0_u8; 10usize],
10635 };
10636 #[cfg(feature = "arbitrary")]
10637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10638 use arbitrary::{Arbitrary, Unstructured};
10639 let mut buf = [0u8; 1024];
10640 rng.fill_bytes(&mut buf);
10641 let mut unstructured = Unstructured::new(&buf);
10642 Self::arbitrary(&mut unstructured).unwrap_or_default()
10643 }
10644}
10645impl Default for DEBUG_VECT_DATA {
10646 fn default() -> Self {
10647 Self::DEFAULT.clone()
10648 }
10649}
10650impl MessageData for DEBUG_VECT_DATA {
10651 type Message = MavMessage;
10652 const ID: u32 = 250u32;
10653 const NAME: &'static str = "DEBUG_VECT";
10654 const EXTRA_CRC: u8 = 49u8;
10655 const ENCODED_LEN: usize = 30usize;
10656 fn deser(
10657 _version: MavlinkVersion,
10658 __input: &[u8],
10659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10660 let avail_len = __input.len();
10661 let mut payload_buf = [0; Self::ENCODED_LEN];
10662 let mut buf = if avail_len < Self::ENCODED_LEN {
10663 payload_buf[0..avail_len].copy_from_slice(__input);
10664 Bytes::new(&payload_buf)
10665 } else {
10666 Bytes::new(__input)
10667 };
10668 let mut __struct = Self::default();
10669 __struct.time_usec = buf.get_u64_le();
10670 __struct.x = buf.get_f32_le();
10671 __struct.y = buf.get_f32_le();
10672 __struct.z = buf.get_f32_le();
10673 for v in &mut __struct.name {
10674 let val = buf.get_u8();
10675 *v = val;
10676 }
10677 Ok(__struct)
10678 }
10679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10680 let mut __tmp = BytesMut::new(bytes);
10681 #[allow(clippy::absurd_extreme_comparisons)]
10682 #[allow(unused_comparisons)]
10683 if __tmp.remaining() < Self::ENCODED_LEN {
10684 panic!(
10685 "buffer is too small (need {} bytes, but got {})",
10686 Self::ENCODED_LEN,
10687 __tmp.remaining(),
10688 )
10689 }
10690 __tmp.put_u64_le(self.time_usec);
10691 __tmp.put_f32_le(self.x);
10692 __tmp.put_f32_le(self.y);
10693 __tmp.put_f32_le(self.z);
10694 for val in &self.name {
10695 __tmp.put_u8(*val);
10696 }
10697 if matches!(version, MavlinkVersion::V2) {
10698 let len = __tmp.len();
10699 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10700 } else {
10701 __tmp.len()
10702 }
10703 }
10704}
10705#[doc = "Distance sensor information for an onboard rangefinder."]
10706#[doc = ""]
10707#[doc = "ID: 132"]
10708#[derive(Debug, Clone, PartialEq)]
10709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10710#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10711#[cfg_attr(feature = "ts", derive(TS))]
10712#[cfg_attr(feature = "ts", ts(export))]
10713pub struct DISTANCE_SENSOR_DATA {
10714 #[doc = "Timestamp (time since system boot)."]
10715 pub time_boot_ms: u32,
10716 #[doc = "Minimum distance the sensor can measure"]
10717 pub min_distance: u16,
10718 #[doc = "Maximum distance the sensor can measure"]
10719 pub max_distance: u16,
10720 #[doc = "Current distance reading"]
10721 pub current_distance: u16,
10722 #[doc = "Type of distance sensor."]
10723 pub mavtype: MavDistanceSensor,
10724 #[doc = "Onboard ID of the sensor"]
10725 pub id: u8,
10726 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10727 pub orientation: MavSensorOrientation,
10728 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10729 pub covariance: u8,
10730 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10731 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10732 pub horizontal_fov: f32,
10733 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10734 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10735 pub vertical_fov: f32,
10736 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10737 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10738 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10739 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10740 pub quaternion: [f32; 4],
10741 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10742 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10743 pub signal_quality: u8,
10744}
10745impl DISTANCE_SENSOR_DATA {
10746 pub const ENCODED_LEN: usize = 39usize;
10747 pub const DEFAULT: Self = Self {
10748 time_boot_ms: 0_u32,
10749 min_distance: 0_u16,
10750 max_distance: 0_u16,
10751 current_distance: 0_u16,
10752 mavtype: MavDistanceSensor::DEFAULT,
10753 id: 0_u8,
10754 orientation: MavSensorOrientation::DEFAULT,
10755 covariance: 0_u8,
10756 horizontal_fov: 0.0_f32,
10757 vertical_fov: 0.0_f32,
10758 quaternion: [0.0_f32; 4usize],
10759 signal_quality: 0_u8,
10760 };
10761 #[cfg(feature = "arbitrary")]
10762 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10763 use arbitrary::{Arbitrary, Unstructured};
10764 let mut buf = [0u8; 1024];
10765 rng.fill_bytes(&mut buf);
10766 let mut unstructured = Unstructured::new(&buf);
10767 Self::arbitrary(&mut unstructured).unwrap_or_default()
10768 }
10769}
10770impl Default for DISTANCE_SENSOR_DATA {
10771 fn default() -> Self {
10772 Self::DEFAULT.clone()
10773 }
10774}
10775impl MessageData for DISTANCE_SENSOR_DATA {
10776 type Message = MavMessage;
10777 const ID: u32 = 132u32;
10778 const NAME: &'static str = "DISTANCE_SENSOR";
10779 const EXTRA_CRC: u8 = 85u8;
10780 const ENCODED_LEN: usize = 39usize;
10781 fn deser(
10782 _version: MavlinkVersion,
10783 __input: &[u8],
10784 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10785 let avail_len = __input.len();
10786 let mut payload_buf = [0; Self::ENCODED_LEN];
10787 let mut buf = if avail_len < Self::ENCODED_LEN {
10788 payload_buf[0..avail_len].copy_from_slice(__input);
10789 Bytes::new(&payload_buf)
10790 } else {
10791 Bytes::new(__input)
10792 };
10793 let mut __struct = Self::default();
10794 __struct.time_boot_ms = buf.get_u32_le();
10795 __struct.min_distance = buf.get_u16_le();
10796 __struct.max_distance = buf.get_u16_le();
10797 __struct.current_distance = buf.get_u16_le();
10798 let tmp = buf.get_u8();
10799 __struct.mavtype =
10800 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10801 enum_type: "MavDistanceSensor",
10802 value: tmp as u32,
10803 })?;
10804 __struct.id = buf.get_u8();
10805 let tmp = buf.get_u8();
10806 __struct.orientation =
10807 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10808 enum_type: "MavSensorOrientation",
10809 value: tmp as u32,
10810 })?;
10811 __struct.covariance = buf.get_u8();
10812 __struct.horizontal_fov = buf.get_f32_le();
10813 __struct.vertical_fov = buf.get_f32_le();
10814 for v in &mut __struct.quaternion {
10815 let val = buf.get_f32_le();
10816 *v = val;
10817 }
10818 __struct.signal_quality = buf.get_u8();
10819 Ok(__struct)
10820 }
10821 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10822 let mut __tmp = BytesMut::new(bytes);
10823 #[allow(clippy::absurd_extreme_comparisons)]
10824 #[allow(unused_comparisons)]
10825 if __tmp.remaining() < Self::ENCODED_LEN {
10826 panic!(
10827 "buffer is too small (need {} bytes, but got {})",
10828 Self::ENCODED_LEN,
10829 __tmp.remaining(),
10830 )
10831 }
10832 __tmp.put_u32_le(self.time_boot_ms);
10833 __tmp.put_u16_le(self.min_distance);
10834 __tmp.put_u16_le(self.max_distance);
10835 __tmp.put_u16_le(self.current_distance);
10836 __tmp.put_u8(self.mavtype as u8);
10837 __tmp.put_u8(self.id);
10838 __tmp.put_u8(self.orientation as u8);
10839 __tmp.put_u8(self.covariance);
10840 if matches!(version, MavlinkVersion::V2) {
10841 __tmp.put_f32_le(self.horizontal_fov);
10842 __tmp.put_f32_le(self.vertical_fov);
10843 for val in &self.quaternion {
10844 __tmp.put_f32_le(*val);
10845 }
10846 __tmp.put_u8(self.signal_quality);
10847 let len = __tmp.len();
10848 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10849 } else {
10850 __tmp.len()
10851 }
10852 }
10853}
10854#[doc = "EFI status output."]
10855#[doc = ""]
10856#[doc = "ID: 225"]
10857#[derive(Debug, Clone, PartialEq)]
10858#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10859#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10860#[cfg_attr(feature = "ts", derive(TS))]
10861#[cfg_attr(feature = "ts", ts(export))]
10862pub struct EFI_STATUS_DATA {
10863 #[doc = "ECU index"]
10864 pub ecu_index: f32,
10865 #[doc = "RPM"]
10866 pub rpm: f32,
10867 #[doc = "Fuel consumed"]
10868 pub fuel_consumed: f32,
10869 #[doc = "Fuel flow rate"]
10870 pub fuel_flow: f32,
10871 #[doc = "Engine load"]
10872 pub engine_load: f32,
10873 #[doc = "Throttle position"]
10874 pub throttle_position: f32,
10875 #[doc = "Spark dwell time"]
10876 pub spark_dwell_time: f32,
10877 #[doc = "Barometric pressure"]
10878 pub barometric_pressure: f32,
10879 #[doc = "Intake manifold pressure("]
10880 pub intake_manifold_pressure: f32,
10881 #[doc = "Intake manifold temperature"]
10882 pub intake_manifold_temperature: f32,
10883 #[doc = "Cylinder head temperature"]
10884 pub cylinder_head_temperature: f32,
10885 #[doc = "Ignition timing (Crank angle degrees)"]
10886 pub ignition_timing: f32,
10887 #[doc = "Injection time"]
10888 pub injection_time: f32,
10889 #[doc = "Exhaust gas temperature"]
10890 pub exhaust_gas_temperature: f32,
10891 #[doc = "Output throttle"]
10892 pub throttle_out: f32,
10893 #[doc = "Pressure/temperature compensation"]
10894 pub pt_compensation: f32,
10895 #[doc = "EFI health status"]
10896 pub health: u8,
10897 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10898 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10899 pub ignition_voltage: f32,
10900 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10901 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10902 pub fuel_pressure: f32,
10903}
10904impl EFI_STATUS_DATA {
10905 pub const ENCODED_LEN: usize = 73usize;
10906 pub const DEFAULT: Self = Self {
10907 ecu_index: 0.0_f32,
10908 rpm: 0.0_f32,
10909 fuel_consumed: 0.0_f32,
10910 fuel_flow: 0.0_f32,
10911 engine_load: 0.0_f32,
10912 throttle_position: 0.0_f32,
10913 spark_dwell_time: 0.0_f32,
10914 barometric_pressure: 0.0_f32,
10915 intake_manifold_pressure: 0.0_f32,
10916 intake_manifold_temperature: 0.0_f32,
10917 cylinder_head_temperature: 0.0_f32,
10918 ignition_timing: 0.0_f32,
10919 injection_time: 0.0_f32,
10920 exhaust_gas_temperature: 0.0_f32,
10921 throttle_out: 0.0_f32,
10922 pt_compensation: 0.0_f32,
10923 health: 0_u8,
10924 ignition_voltage: 0.0_f32,
10925 fuel_pressure: 0.0_f32,
10926 };
10927 #[cfg(feature = "arbitrary")]
10928 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10929 use arbitrary::{Arbitrary, Unstructured};
10930 let mut buf = [0u8; 1024];
10931 rng.fill_bytes(&mut buf);
10932 let mut unstructured = Unstructured::new(&buf);
10933 Self::arbitrary(&mut unstructured).unwrap_or_default()
10934 }
10935}
10936impl Default for EFI_STATUS_DATA {
10937 fn default() -> Self {
10938 Self::DEFAULT.clone()
10939 }
10940}
10941impl MessageData for EFI_STATUS_DATA {
10942 type Message = MavMessage;
10943 const ID: u32 = 225u32;
10944 const NAME: &'static str = "EFI_STATUS";
10945 const EXTRA_CRC: u8 = 208u8;
10946 const ENCODED_LEN: usize = 73usize;
10947 fn deser(
10948 _version: MavlinkVersion,
10949 __input: &[u8],
10950 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10951 let avail_len = __input.len();
10952 let mut payload_buf = [0; Self::ENCODED_LEN];
10953 let mut buf = if avail_len < Self::ENCODED_LEN {
10954 payload_buf[0..avail_len].copy_from_slice(__input);
10955 Bytes::new(&payload_buf)
10956 } else {
10957 Bytes::new(__input)
10958 };
10959 let mut __struct = Self::default();
10960 __struct.ecu_index = buf.get_f32_le();
10961 __struct.rpm = buf.get_f32_le();
10962 __struct.fuel_consumed = buf.get_f32_le();
10963 __struct.fuel_flow = buf.get_f32_le();
10964 __struct.engine_load = buf.get_f32_le();
10965 __struct.throttle_position = buf.get_f32_le();
10966 __struct.spark_dwell_time = buf.get_f32_le();
10967 __struct.barometric_pressure = buf.get_f32_le();
10968 __struct.intake_manifold_pressure = buf.get_f32_le();
10969 __struct.intake_manifold_temperature = buf.get_f32_le();
10970 __struct.cylinder_head_temperature = buf.get_f32_le();
10971 __struct.ignition_timing = buf.get_f32_le();
10972 __struct.injection_time = buf.get_f32_le();
10973 __struct.exhaust_gas_temperature = buf.get_f32_le();
10974 __struct.throttle_out = buf.get_f32_le();
10975 __struct.pt_compensation = buf.get_f32_le();
10976 __struct.health = buf.get_u8();
10977 __struct.ignition_voltage = buf.get_f32_le();
10978 __struct.fuel_pressure = buf.get_f32_le();
10979 Ok(__struct)
10980 }
10981 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10982 let mut __tmp = BytesMut::new(bytes);
10983 #[allow(clippy::absurd_extreme_comparisons)]
10984 #[allow(unused_comparisons)]
10985 if __tmp.remaining() < Self::ENCODED_LEN {
10986 panic!(
10987 "buffer is too small (need {} bytes, but got {})",
10988 Self::ENCODED_LEN,
10989 __tmp.remaining(),
10990 )
10991 }
10992 __tmp.put_f32_le(self.ecu_index);
10993 __tmp.put_f32_le(self.rpm);
10994 __tmp.put_f32_le(self.fuel_consumed);
10995 __tmp.put_f32_le(self.fuel_flow);
10996 __tmp.put_f32_le(self.engine_load);
10997 __tmp.put_f32_le(self.throttle_position);
10998 __tmp.put_f32_le(self.spark_dwell_time);
10999 __tmp.put_f32_le(self.barometric_pressure);
11000 __tmp.put_f32_le(self.intake_manifold_pressure);
11001 __tmp.put_f32_le(self.intake_manifold_temperature);
11002 __tmp.put_f32_le(self.cylinder_head_temperature);
11003 __tmp.put_f32_le(self.ignition_timing);
11004 __tmp.put_f32_le(self.injection_time);
11005 __tmp.put_f32_le(self.exhaust_gas_temperature);
11006 __tmp.put_f32_le(self.throttle_out);
11007 __tmp.put_f32_le(self.pt_compensation);
11008 __tmp.put_u8(self.health);
11009 if matches!(version, MavlinkVersion::V2) {
11010 __tmp.put_f32_le(self.ignition_voltage);
11011 __tmp.put_f32_le(self.fuel_pressure);
11012 let len = __tmp.len();
11013 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11014 } else {
11015 __tmp.len()
11016 }
11017 }
11018}
11019#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11020#[doc = ""]
11021#[doc = "ID: 131"]
11022#[derive(Debug, Clone, PartialEq)]
11023#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11024#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11025#[cfg_attr(feature = "ts", derive(TS))]
11026#[cfg_attr(feature = "ts", ts(export))]
11027pub struct ENCAPSULATED_DATA_DATA {
11028 #[doc = "sequence number (starting with 0 on every transmission)"]
11029 pub seqnr: u16,
11030 #[doc = "image data bytes"]
11031 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11032 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11033 pub data: [u8; 253],
11034}
11035impl ENCAPSULATED_DATA_DATA {
11036 pub const ENCODED_LEN: usize = 255usize;
11037 pub const DEFAULT: Self = Self {
11038 seqnr: 0_u16,
11039 data: [0_u8; 253usize],
11040 };
11041 #[cfg(feature = "arbitrary")]
11042 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11043 use arbitrary::{Arbitrary, Unstructured};
11044 let mut buf = [0u8; 1024];
11045 rng.fill_bytes(&mut buf);
11046 let mut unstructured = Unstructured::new(&buf);
11047 Self::arbitrary(&mut unstructured).unwrap_or_default()
11048 }
11049}
11050impl Default for ENCAPSULATED_DATA_DATA {
11051 fn default() -> Self {
11052 Self::DEFAULT.clone()
11053 }
11054}
11055impl MessageData for ENCAPSULATED_DATA_DATA {
11056 type Message = MavMessage;
11057 const ID: u32 = 131u32;
11058 const NAME: &'static str = "ENCAPSULATED_DATA";
11059 const EXTRA_CRC: u8 = 223u8;
11060 const ENCODED_LEN: usize = 255usize;
11061 fn deser(
11062 _version: MavlinkVersion,
11063 __input: &[u8],
11064 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11065 let avail_len = __input.len();
11066 let mut payload_buf = [0; Self::ENCODED_LEN];
11067 let mut buf = if avail_len < Self::ENCODED_LEN {
11068 payload_buf[0..avail_len].copy_from_slice(__input);
11069 Bytes::new(&payload_buf)
11070 } else {
11071 Bytes::new(__input)
11072 };
11073 let mut __struct = Self::default();
11074 __struct.seqnr = buf.get_u16_le();
11075 for v in &mut __struct.data {
11076 let val = buf.get_u8();
11077 *v = val;
11078 }
11079 Ok(__struct)
11080 }
11081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11082 let mut __tmp = BytesMut::new(bytes);
11083 #[allow(clippy::absurd_extreme_comparisons)]
11084 #[allow(unused_comparisons)]
11085 if __tmp.remaining() < Self::ENCODED_LEN {
11086 panic!(
11087 "buffer is too small (need {} bytes, but got {})",
11088 Self::ENCODED_LEN,
11089 __tmp.remaining(),
11090 )
11091 }
11092 __tmp.put_u16_le(self.seqnr);
11093 for val in &self.data {
11094 __tmp.put_u8(*val);
11095 }
11096 if matches!(version, MavlinkVersion::V2) {
11097 let len = __tmp.len();
11098 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11099 } else {
11100 __tmp.len()
11101 }
11102 }
11103}
11104#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11105#[doc = ""]
11106#[doc = "ID: 290"]
11107#[derive(Debug, Clone, PartialEq)]
11108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11109#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11110#[cfg_attr(feature = "ts", derive(TS))]
11111#[cfg_attr(feature = "ts", ts(export))]
11112pub struct ESC_INFO_DATA {
11113 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11114 pub time_usec: u64,
11115 #[doc = "Number of reported errors by each ESC since boot."]
11116 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11117 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11118 pub error_count: [u32; 4],
11119 #[doc = "Counter of data packets received."]
11120 pub counter: u16,
11121 #[doc = "Bitmap of ESC failure flags."]
11122 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11123 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11124 pub failure_flags: [u16; 4],
11125 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11126 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11127 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11128 pub temperature: [i16; 4],
11129 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11130 pub index: u8,
11131 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11132 pub count: u8,
11133 #[doc = "Connection type protocol for all ESC."]
11134 pub connection_type: EscConnectionType,
11135 #[doc = "Information regarding online/offline status of each ESC."]
11136 pub info: u8,
11137}
11138impl ESC_INFO_DATA {
11139 pub const ENCODED_LEN: usize = 46usize;
11140 pub const DEFAULT: Self = Self {
11141 time_usec: 0_u64,
11142 error_count: [0_u32; 4usize],
11143 counter: 0_u16,
11144 failure_flags: [0_u16; 4usize],
11145 temperature: [0_i16; 4usize],
11146 index: 0_u8,
11147 count: 0_u8,
11148 connection_type: EscConnectionType::DEFAULT,
11149 info: 0_u8,
11150 };
11151 #[cfg(feature = "arbitrary")]
11152 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11153 use arbitrary::{Arbitrary, Unstructured};
11154 let mut buf = [0u8; 1024];
11155 rng.fill_bytes(&mut buf);
11156 let mut unstructured = Unstructured::new(&buf);
11157 Self::arbitrary(&mut unstructured).unwrap_or_default()
11158 }
11159}
11160impl Default for ESC_INFO_DATA {
11161 fn default() -> Self {
11162 Self::DEFAULT.clone()
11163 }
11164}
11165impl MessageData for ESC_INFO_DATA {
11166 type Message = MavMessage;
11167 const ID: u32 = 290u32;
11168 const NAME: &'static str = "ESC_INFO";
11169 const EXTRA_CRC: u8 = 251u8;
11170 const ENCODED_LEN: usize = 46usize;
11171 fn deser(
11172 _version: MavlinkVersion,
11173 __input: &[u8],
11174 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11175 let avail_len = __input.len();
11176 let mut payload_buf = [0; Self::ENCODED_LEN];
11177 let mut buf = if avail_len < Self::ENCODED_LEN {
11178 payload_buf[0..avail_len].copy_from_slice(__input);
11179 Bytes::new(&payload_buf)
11180 } else {
11181 Bytes::new(__input)
11182 };
11183 let mut __struct = Self::default();
11184 __struct.time_usec = buf.get_u64_le();
11185 for v in &mut __struct.error_count {
11186 let val = buf.get_u32_le();
11187 *v = val;
11188 }
11189 __struct.counter = buf.get_u16_le();
11190 for v in &mut __struct.failure_flags {
11191 let val = buf.get_u16_le();
11192 *v = val;
11193 }
11194 for v in &mut __struct.temperature {
11195 let val = buf.get_i16_le();
11196 *v = val;
11197 }
11198 __struct.index = buf.get_u8();
11199 __struct.count = buf.get_u8();
11200 let tmp = buf.get_u8();
11201 __struct.connection_type =
11202 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11203 enum_type: "EscConnectionType",
11204 value: tmp as u32,
11205 })?;
11206 __struct.info = buf.get_u8();
11207 Ok(__struct)
11208 }
11209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11210 let mut __tmp = BytesMut::new(bytes);
11211 #[allow(clippy::absurd_extreme_comparisons)]
11212 #[allow(unused_comparisons)]
11213 if __tmp.remaining() < Self::ENCODED_LEN {
11214 panic!(
11215 "buffer is too small (need {} bytes, but got {})",
11216 Self::ENCODED_LEN,
11217 __tmp.remaining(),
11218 )
11219 }
11220 __tmp.put_u64_le(self.time_usec);
11221 for val in &self.error_count {
11222 __tmp.put_u32_le(*val);
11223 }
11224 __tmp.put_u16_le(self.counter);
11225 for val in &self.failure_flags {
11226 __tmp.put_u16_le(*val);
11227 }
11228 for val in &self.temperature {
11229 __tmp.put_i16_le(*val);
11230 }
11231 __tmp.put_u8(self.index);
11232 __tmp.put_u8(self.count);
11233 __tmp.put_u8(self.connection_type as u8);
11234 __tmp.put_u8(self.info);
11235 if matches!(version, MavlinkVersion::V2) {
11236 let len = __tmp.len();
11237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11238 } else {
11239 __tmp.len()
11240 }
11241 }
11242}
11243#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11244#[doc = ""]
11245#[doc = "ID: 291"]
11246#[derive(Debug, Clone, PartialEq)]
11247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11249#[cfg_attr(feature = "ts", derive(TS))]
11250#[cfg_attr(feature = "ts", ts(export))]
11251pub struct ESC_STATUS_DATA {
11252 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11253 pub time_usec: u64,
11254 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11255 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11256 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11257 pub rpm: [i32; 4],
11258 #[doc = "Voltage measured from each ESC."]
11259 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11260 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11261 pub voltage: [f32; 4],
11262 #[doc = "Current measured from each ESC."]
11263 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11264 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11265 pub current: [f32; 4],
11266 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11267 pub index: u8,
11268}
11269impl ESC_STATUS_DATA {
11270 pub const ENCODED_LEN: usize = 57usize;
11271 pub const DEFAULT: Self = Self {
11272 time_usec: 0_u64,
11273 rpm: [0_i32; 4usize],
11274 voltage: [0.0_f32; 4usize],
11275 current: [0.0_f32; 4usize],
11276 index: 0_u8,
11277 };
11278 #[cfg(feature = "arbitrary")]
11279 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11280 use arbitrary::{Arbitrary, Unstructured};
11281 let mut buf = [0u8; 1024];
11282 rng.fill_bytes(&mut buf);
11283 let mut unstructured = Unstructured::new(&buf);
11284 Self::arbitrary(&mut unstructured).unwrap_or_default()
11285 }
11286}
11287impl Default for ESC_STATUS_DATA {
11288 fn default() -> Self {
11289 Self::DEFAULT.clone()
11290 }
11291}
11292impl MessageData for ESC_STATUS_DATA {
11293 type Message = MavMessage;
11294 const ID: u32 = 291u32;
11295 const NAME: &'static str = "ESC_STATUS";
11296 const EXTRA_CRC: u8 = 10u8;
11297 const ENCODED_LEN: usize = 57usize;
11298 fn deser(
11299 _version: MavlinkVersion,
11300 __input: &[u8],
11301 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11302 let avail_len = __input.len();
11303 let mut payload_buf = [0; Self::ENCODED_LEN];
11304 let mut buf = if avail_len < Self::ENCODED_LEN {
11305 payload_buf[0..avail_len].copy_from_slice(__input);
11306 Bytes::new(&payload_buf)
11307 } else {
11308 Bytes::new(__input)
11309 };
11310 let mut __struct = Self::default();
11311 __struct.time_usec = buf.get_u64_le();
11312 for v in &mut __struct.rpm {
11313 let val = buf.get_i32_le();
11314 *v = val;
11315 }
11316 for v in &mut __struct.voltage {
11317 let val = buf.get_f32_le();
11318 *v = val;
11319 }
11320 for v in &mut __struct.current {
11321 let val = buf.get_f32_le();
11322 *v = val;
11323 }
11324 __struct.index = buf.get_u8();
11325 Ok(__struct)
11326 }
11327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11328 let mut __tmp = BytesMut::new(bytes);
11329 #[allow(clippy::absurd_extreme_comparisons)]
11330 #[allow(unused_comparisons)]
11331 if __tmp.remaining() < Self::ENCODED_LEN {
11332 panic!(
11333 "buffer is too small (need {} bytes, but got {})",
11334 Self::ENCODED_LEN,
11335 __tmp.remaining(),
11336 )
11337 }
11338 __tmp.put_u64_le(self.time_usec);
11339 for val in &self.rpm {
11340 __tmp.put_i32_le(*val);
11341 }
11342 for val in &self.voltage {
11343 __tmp.put_f32_le(*val);
11344 }
11345 for val in &self.current {
11346 __tmp.put_f32_le(*val);
11347 }
11348 __tmp.put_u8(self.index);
11349 if matches!(version, MavlinkVersion::V2) {
11350 let len = __tmp.len();
11351 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11352 } else {
11353 __tmp.len()
11354 }
11355 }
11356}
11357#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11358#[doc = ""]
11359#[doc = "ID: 230"]
11360#[derive(Debug, Clone, PartialEq)]
11361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11362#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11363#[cfg_attr(feature = "ts", derive(TS))]
11364#[cfg_attr(feature = "ts", ts(export))]
11365pub struct ESTIMATOR_STATUS_DATA {
11366 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11367 pub time_usec: u64,
11368 #[doc = "Velocity innovation test ratio"]
11369 pub vel_ratio: f32,
11370 #[doc = "Horizontal position innovation test ratio"]
11371 pub pos_horiz_ratio: f32,
11372 #[doc = "Vertical position innovation test ratio"]
11373 pub pos_vert_ratio: f32,
11374 #[doc = "Magnetometer innovation test ratio"]
11375 pub mag_ratio: f32,
11376 #[doc = "Height above terrain innovation test ratio"]
11377 pub hagl_ratio: f32,
11378 #[doc = "True airspeed innovation test ratio"]
11379 pub tas_ratio: f32,
11380 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11381 pub pos_horiz_accuracy: f32,
11382 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11383 pub pos_vert_accuracy: f32,
11384 #[doc = "Bitmap indicating which EKF outputs are valid."]
11385 pub flags: EstimatorStatusFlags,
11386}
11387impl ESTIMATOR_STATUS_DATA {
11388 pub const ENCODED_LEN: usize = 42usize;
11389 pub const DEFAULT: Self = Self {
11390 time_usec: 0_u64,
11391 vel_ratio: 0.0_f32,
11392 pos_horiz_ratio: 0.0_f32,
11393 pos_vert_ratio: 0.0_f32,
11394 mag_ratio: 0.0_f32,
11395 hagl_ratio: 0.0_f32,
11396 tas_ratio: 0.0_f32,
11397 pos_horiz_accuracy: 0.0_f32,
11398 pos_vert_accuracy: 0.0_f32,
11399 flags: EstimatorStatusFlags::DEFAULT,
11400 };
11401 #[cfg(feature = "arbitrary")]
11402 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11403 use arbitrary::{Arbitrary, Unstructured};
11404 let mut buf = [0u8; 1024];
11405 rng.fill_bytes(&mut buf);
11406 let mut unstructured = Unstructured::new(&buf);
11407 Self::arbitrary(&mut unstructured).unwrap_or_default()
11408 }
11409}
11410impl Default for ESTIMATOR_STATUS_DATA {
11411 fn default() -> Self {
11412 Self::DEFAULT.clone()
11413 }
11414}
11415impl MessageData for ESTIMATOR_STATUS_DATA {
11416 type Message = MavMessage;
11417 const ID: u32 = 230u32;
11418 const NAME: &'static str = "ESTIMATOR_STATUS";
11419 const EXTRA_CRC: u8 = 163u8;
11420 const ENCODED_LEN: usize = 42usize;
11421 fn deser(
11422 _version: MavlinkVersion,
11423 __input: &[u8],
11424 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11425 let avail_len = __input.len();
11426 let mut payload_buf = [0; Self::ENCODED_LEN];
11427 let mut buf = if avail_len < Self::ENCODED_LEN {
11428 payload_buf[0..avail_len].copy_from_slice(__input);
11429 Bytes::new(&payload_buf)
11430 } else {
11431 Bytes::new(__input)
11432 };
11433 let mut __struct = Self::default();
11434 __struct.time_usec = buf.get_u64_le();
11435 __struct.vel_ratio = buf.get_f32_le();
11436 __struct.pos_horiz_ratio = buf.get_f32_le();
11437 __struct.pos_vert_ratio = buf.get_f32_le();
11438 __struct.mag_ratio = buf.get_f32_le();
11439 __struct.hagl_ratio = buf.get_f32_le();
11440 __struct.tas_ratio = buf.get_f32_le();
11441 __struct.pos_horiz_accuracy = buf.get_f32_le();
11442 __struct.pos_vert_accuracy = buf.get_f32_le();
11443 let tmp = buf.get_u16_le();
11444 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11445 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11446 flag_type: "EstimatorStatusFlags",
11447 value: tmp as u32,
11448 })?;
11449 Ok(__struct)
11450 }
11451 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11452 let mut __tmp = BytesMut::new(bytes);
11453 #[allow(clippy::absurd_extreme_comparisons)]
11454 #[allow(unused_comparisons)]
11455 if __tmp.remaining() < Self::ENCODED_LEN {
11456 panic!(
11457 "buffer is too small (need {} bytes, but got {})",
11458 Self::ENCODED_LEN,
11459 __tmp.remaining(),
11460 )
11461 }
11462 __tmp.put_u64_le(self.time_usec);
11463 __tmp.put_f32_le(self.vel_ratio);
11464 __tmp.put_f32_le(self.pos_horiz_ratio);
11465 __tmp.put_f32_le(self.pos_vert_ratio);
11466 __tmp.put_f32_le(self.mag_ratio);
11467 __tmp.put_f32_le(self.hagl_ratio);
11468 __tmp.put_f32_le(self.tas_ratio);
11469 __tmp.put_f32_le(self.pos_horiz_accuracy);
11470 __tmp.put_f32_le(self.pos_vert_accuracy);
11471 __tmp.put_u16_le(self.flags.bits());
11472 if matches!(version, MavlinkVersion::V2) {
11473 let len = __tmp.len();
11474 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11475 } else {
11476 __tmp.len()
11477 }
11478 }
11479}
11480#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11481#[doc = ""]
11482#[doc = "ID: 410"]
11483#[derive(Debug, Clone, PartialEq)]
11484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11486#[cfg_attr(feature = "ts", derive(TS))]
11487#[cfg_attr(feature = "ts", ts(export))]
11488pub struct EVENT_DATA {
11489 #[doc = "Event ID (as defined in the component metadata)"]
11490 pub id: u32,
11491 #[doc = "Timestamp (time since system boot when the event happened)."]
11492 pub event_time_boot_ms: u32,
11493 #[doc = "Sequence number."]
11494 pub sequence: u16,
11495 #[doc = "Component ID"]
11496 pub destination_component: u8,
11497 #[doc = "System ID"]
11498 pub destination_system: u8,
11499 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11500 pub log_levels: u8,
11501 #[doc = "Arguments (depend on event ID)."]
11502 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11503 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11504 pub arguments: [u8; 40],
11505}
11506impl EVENT_DATA {
11507 pub const ENCODED_LEN: usize = 53usize;
11508 pub const DEFAULT: Self = Self {
11509 id: 0_u32,
11510 event_time_boot_ms: 0_u32,
11511 sequence: 0_u16,
11512 destination_component: 0_u8,
11513 destination_system: 0_u8,
11514 log_levels: 0_u8,
11515 arguments: [0_u8; 40usize],
11516 };
11517 #[cfg(feature = "arbitrary")]
11518 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11519 use arbitrary::{Arbitrary, Unstructured};
11520 let mut buf = [0u8; 1024];
11521 rng.fill_bytes(&mut buf);
11522 let mut unstructured = Unstructured::new(&buf);
11523 Self::arbitrary(&mut unstructured).unwrap_or_default()
11524 }
11525}
11526impl Default for EVENT_DATA {
11527 fn default() -> Self {
11528 Self::DEFAULT.clone()
11529 }
11530}
11531impl MessageData for EVENT_DATA {
11532 type Message = MavMessage;
11533 const ID: u32 = 410u32;
11534 const NAME: &'static str = "EVENT";
11535 const EXTRA_CRC: u8 = 160u8;
11536 const ENCODED_LEN: usize = 53usize;
11537 fn deser(
11538 _version: MavlinkVersion,
11539 __input: &[u8],
11540 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11541 let avail_len = __input.len();
11542 let mut payload_buf = [0; Self::ENCODED_LEN];
11543 let mut buf = if avail_len < Self::ENCODED_LEN {
11544 payload_buf[0..avail_len].copy_from_slice(__input);
11545 Bytes::new(&payload_buf)
11546 } else {
11547 Bytes::new(__input)
11548 };
11549 let mut __struct = Self::default();
11550 __struct.id = buf.get_u32_le();
11551 __struct.event_time_boot_ms = buf.get_u32_le();
11552 __struct.sequence = buf.get_u16_le();
11553 __struct.destination_component = buf.get_u8();
11554 __struct.destination_system = buf.get_u8();
11555 __struct.log_levels = buf.get_u8();
11556 for v in &mut __struct.arguments {
11557 let val = buf.get_u8();
11558 *v = val;
11559 }
11560 Ok(__struct)
11561 }
11562 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11563 let mut __tmp = BytesMut::new(bytes);
11564 #[allow(clippy::absurd_extreme_comparisons)]
11565 #[allow(unused_comparisons)]
11566 if __tmp.remaining() < Self::ENCODED_LEN {
11567 panic!(
11568 "buffer is too small (need {} bytes, but got {})",
11569 Self::ENCODED_LEN,
11570 __tmp.remaining(),
11571 )
11572 }
11573 __tmp.put_u32_le(self.id);
11574 __tmp.put_u32_le(self.event_time_boot_ms);
11575 __tmp.put_u16_le(self.sequence);
11576 __tmp.put_u8(self.destination_component);
11577 __tmp.put_u8(self.destination_system);
11578 __tmp.put_u8(self.log_levels);
11579 for val in &self.arguments {
11580 __tmp.put_u8(*val);
11581 }
11582 if matches!(version, MavlinkVersion::V2) {
11583 let len = __tmp.len();
11584 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11585 } else {
11586 __tmp.len()
11587 }
11588 }
11589}
11590#[doc = "Provides state for additional features."]
11591#[doc = ""]
11592#[doc = "ID: 245"]
11593#[derive(Debug, Clone, PartialEq)]
11594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11595#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11596#[cfg_attr(feature = "ts", derive(TS))]
11597#[cfg_attr(feature = "ts", ts(export))]
11598pub struct EXTENDED_SYS_STATE_DATA {
11599 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11600 pub vtol_state: MavVtolState,
11601 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11602 pub landed_state: MavLandedState,
11603}
11604impl EXTENDED_SYS_STATE_DATA {
11605 pub const ENCODED_LEN: usize = 2usize;
11606 pub const DEFAULT: Self = Self {
11607 vtol_state: MavVtolState::DEFAULT,
11608 landed_state: MavLandedState::DEFAULT,
11609 };
11610 #[cfg(feature = "arbitrary")]
11611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11612 use arbitrary::{Arbitrary, Unstructured};
11613 let mut buf = [0u8; 1024];
11614 rng.fill_bytes(&mut buf);
11615 let mut unstructured = Unstructured::new(&buf);
11616 Self::arbitrary(&mut unstructured).unwrap_or_default()
11617 }
11618}
11619impl Default for EXTENDED_SYS_STATE_DATA {
11620 fn default() -> Self {
11621 Self::DEFAULT.clone()
11622 }
11623}
11624impl MessageData for EXTENDED_SYS_STATE_DATA {
11625 type Message = MavMessage;
11626 const ID: u32 = 245u32;
11627 const NAME: &'static str = "EXTENDED_SYS_STATE";
11628 const EXTRA_CRC: u8 = 130u8;
11629 const ENCODED_LEN: usize = 2usize;
11630 fn deser(
11631 _version: MavlinkVersion,
11632 __input: &[u8],
11633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11634 let avail_len = __input.len();
11635 let mut payload_buf = [0; Self::ENCODED_LEN];
11636 let mut buf = if avail_len < Self::ENCODED_LEN {
11637 payload_buf[0..avail_len].copy_from_slice(__input);
11638 Bytes::new(&payload_buf)
11639 } else {
11640 Bytes::new(__input)
11641 };
11642 let mut __struct = Self::default();
11643 let tmp = buf.get_u8();
11644 __struct.vtol_state =
11645 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11646 enum_type: "MavVtolState",
11647 value: tmp as u32,
11648 })?;
11649 let tmp = buf.get_u8();
11650 __struct.landed_state =
11651 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11652 enum_type: "MavLandedState",
11653 value: tmp as u32,
11654 })?;
11655 Ok(__struct)
11656 }
11657 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11658 let mut __tmp = BytesMut::new(bytes);
11659 #[allow(clippy::absurd_extreme_comparisons)]
11660 #[allow(unused_comparisons)]
11661 if __tmp.remaining() < Self::ENCODED_LEN {
11662 panic!(
11663 "buffer is too small (need {} bytes, but got {})",
11664 Self::ENCODED_LEN,
11665 __tmp.remaining(),
11666 )
11667 }
11668 __tmp.put_u8(self.vtol_state as u8);
11669 __tmp.put_u8(self.landed_state as u8);
11670 if matches!(version, MavlinkVersion::V2) {
11671 let len = __tmp.len();
11672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11673 } else {
11674 __tmp.len()
11675 }
11676 }
11677}
11678#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11679#[doc = ""]
11680#[doc = "ID: 162"]
11681#[derive(Debug, Clone, PartialEq)]
11682#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11683#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11684#[cfg_attr(feature = "ts", derive(TS))]
11685#[cfg_attr(feature = "ts", ts(export))]
11686pub struct FENCE_STATUS_DATA {
11687 #[doc = "Time (since boot) of last breach."]
11688 pub breach_time: u32,
11689 #[doc = "Number of fence breaches."]
11690 pub breach_count: u16,
11691 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11692 pub breach_status: u8,
11693 #[doc = "Last breach type."]
11694 pub breach_type: FenceBreach,
11695 #[doc = "Active action to prevent fence breach"]
11696 #[cfg_attr(feature = "serde", serde(default))]
11697 pub breach_mitigation: FenceMitigate,
11698}
11699impl FENCE_STATUS_DATA {
11700 pub const ENCODED_LEN: usize = 9usize;
11701 pub const DEFAULT: Self = Self {
11702 breach_time: 0_u32,
11703 breach_count: 0_u16,
11704 breach_status: 0_u8,
11705 breach_type: FenceBreach::DEFAULT,
11706 breach_mitigation: FenceMitigate::DEFAULT,
11707 };
11708 #[cfg(feature = "arbitrary")]
11709 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11710 use arbitrary::{Arbitrary, Unstructured};
11711 let mut buf = [0u8; 1024];
11712 rng.fill_bytes(&mut buf);
11713 let mut unstructured = Unstructured::new(&buf);
11714 Self::arbitrary(&mut unstructured).unwrap_or_default()
11715 }
11716}
11717impl Default for FENCE_STATUS_DATA {
11718 fn default() -> Self {
11719 Self::DEFAULT.clone()
11720 }
11721}
11722impl MessageData for FENCE_STATUS_DATA {
11723 type Message = MavMessage;
11724 const ID: u32 = 162u32;
11725 const NAME: &'static str = "FENCE_STATUS";
11726 const EXTRA_CRC: u8 = 189u8;
11727 const ENCODED_LEN: usize = 9usize;
11728 fn deser(
11729 _version: MavlinkVersion,
11730 __input: &[u8],
11731 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11732 let avail_len = __input.len();
11733 let mut payload_buf = [0; Self::ENCODED_LEN];
11734 let mut buf = if avail_len < Self::ENCODED_LEN {
11735 payload_buf[0..avail_len].copy_from_slice(__input);
11736 Bytes::new(&payload_buf)
11737 } else {
11738 Bytes::new(__input)
11739 };
11740 let mut __struct = Self::default();
11741 __struct.breach_time = buf.get_u32_le();
11742 __struct.breach_count = buf.get_u16_le();
11743 __struct.breach_status = buf.get_u8();
11744 let tmp = buf.get_u8();
11745 __struct.breach_type =
11746 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11747 enum_type: "FenceBreach",
11748 value: tmp as u32,
11749 })?;
11750 let tmp = buf.get_u8();
11751 __struct.breach_mitigation =
11752 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11753 enum_type: "FenceMitigate",
11754 value: tmp as u32,
11755 })?;
11756 Ok(__struct)
11757 }
11758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11759 let mut __tmp = BytesMut::new(bytes);
11760 #[allow(clippy::absurd_extreme_comparisons)]
11761 #[allow(unused_comparisons)]
11762 if __tmp.remaining() < Self::ENCODED_LEN {
11763 panic!(
11764 "buffer is too small (need {} bytes, but got {})",
11765 Self::ENCODED_LEN,
11766 __tmp.remaining(),
11767 )
11768 }
11769 __tmp.put_u32_le(self.breach_time);
11770 __tmp.put_u16_le(self.breach_count);
11771 __tmp.put_u8(self.breach_status);
11772 __tmp.put_u8(self.breach_type as u8);
11773 if matches!(version, MavlinkVersion::V2) {
11774 __tmp.put_u8(self.breach_mitigation as u8);
11775 let len = __tmp.len();
11776 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11777 } else {
11778 __tmp.len()
11779 }
11780 }
11781}
11782#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11783#[doc = ""]
11784#[doc = "ID: 110"]
11785#[derive(Debug, Clone, PartialEq)]
11786#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11788#[cfg_attr(feature = "ts", derive(TS))]
11789#[cfg_attr(feature = "ts", ts(export))]
11790pub struct FILE_TRANSFER_PROTOCOL_DATA {
11791 #[doc = "Network ID (0 for broadcast)"]
11792 pub target_network: u8,
11793 #[doc = "System ID (0 for broadcast)"]
11794 pub target_system: u8,
11795 #[doc = "Component ID (0 for broadcast)"]
11796 pub target_component: u8,
11797 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11798 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11799 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11800 pub payload: [u8; 251],
11801}
11802impl FILE_TRANSFER_PROTOCOL_DATA {
11803 pub const ENCODED_LEN: usize = 254usize;
11804 pub const DEFAULT: Self = Self {
11805 target_network: 0_u8,
11806 target_system: 0_u8,
11807 target_component: 0_u8,
11808 payload: [0_u8; 251usize],
11809 };
11810 #[cfg(feature = "arbitrary")]
11811 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11812 use arbitrary::{Arbitrary, Unstructured};
11813 let mut buf = [0u8; 1024];
11814 rng.fill_bytes(&mut buf);
11815 let mut unstructured = Unstructured::new(&buf);
11816 Self::arbitrary(&mut unstructured).unwrap_or_default()
11817 }
11818}
11819impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11820 fn default() -> Self {
11821 Self::DEFAULT.clone()
11822 }
11823}
11824impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11825 type Message = MavMessage;
11826 const ID: u32 = 110u32;
11827 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11828 const EXTRA_CRC: u8 = 84u8;
11829 const ENCODED_LEN: usize = 254usize;
11830 fn deser(
11831 _version: MavlinkVersion,
11832 __input: &[u8],
11833 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11834 let avail_len = __input.len();
11835 let mut payload_buf = [0; Self::ENCODED_LEN];
11836 let mut buf = if avail_len < Self::ENCODED_LEN {
11837 payload_buf[0..avail_len].copy_from_slice(__input);
11838 Bytes::new(&payload_buf)
11839 } else {
11840 Bytes::new(__input)
11841 };
11842 let mut __struct = Self::default();
11843 __struct.target_network = buf.get_u8();
11844 __struct.target_system = buf.get_u8();
11845 __struct.target_component = buf.get_u8();
11846 for v in &mut __struct.payload {
11847 let val = buf.get_u8();
11848 *v = val;
11849 }
11850 Ok(__struct)
11851 }
11852 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11853 let mut __tmp = BytesMut::new(bytes);
11854 #[allow(clippy::absurd_extreme_comparisons)]
11855 #[allow(unused_comparisons)]
11856 if __tmp.remaining() < Self::ENCODED_LEN {
11857 panic!(
11858 "buffer is too small (need {} bytes, but got {})",
11859 Self::ENCODED_LEN,
11860 __tmp.remaining(),
11861 )
11862 }
11863 __tmp.put_u8(self.target_network);
11864 __tmp.put_u8(self.target_system);
11865 __tmp.put_u8(self.target_component);
11866 for val in &self.payload {
11867 __tmp.put_u8(*val);
11868 }
11869 if matches!(version, MavlinkVersion::V2) {
11870 let len = __tmp.len();
11871 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11872 } else {
11873 __tmp.len()
11874 }
11875 }
11876}
11877#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11878#[doc = ""]
11879#[doc = "ID: 264"]
11880#[derive(Debug, Clone, PartialEq)]
11881#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11882#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11883#[cfg_attr(feature = "ts", derive(TS))]
11884#[cfg_attr(feature = "ts", ts(export))]
11885pub struct FLIGHT_INFORMATION_DATA {
11886 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11887 pub arming_time_utc: u64,
11888 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11889 pub takeoff_time_utc: u64,
11890 #[doc = "Flight number. Note, field is misnamed UUID."]
11891 pub flight_uuid: u64,
11892 #[doc = "Timestamp (time since system boot)."]
11893 pub time_boot_ms: u32,
11894 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11895 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11896 pub landing_time: u32,
11897}
11898impl FLIGHT_INFORMATION_DATA {
11899 pub const ENCODED_LEN: usize = 32usize;
11900 pub const DEFAULT: Self = Self {
11901 arming_time_utc: 0_u64,
11902 takeoff_time_utc: 0_u64,
11903 flight_uuid: 0_u64,
11904 time_boot_ms: 0_u32,
11905 landing_time: 0_u32,
11906 };
11907 #[cfg(feature = "arbitrary")]
11908 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11909 use arbitrary::{Arbitrary, Unstructured};
11910 let mut buf = [0u8; 1024];
11911 rng.fill_bytes(&mut buf);
11912 let mut unstructured = Unstructured::new(&buf);
11913 Self::arbitrary(&mut unstructured).unwrap_or_default()
11914 }
11915}
11916impl Default for FLIGHT_INFORMATION_DATA {
11917 fn default() -> Self {
11918 Self::DEFAULT.clone()
11919 }
11920}
11921impl MessageData for FLIGHT_INFORMATION_DATA {
11922 type Message = MavMessage;
11923 const ID: u32 = 264u32;
11924 const NAME: &'static str = "FLIGHT_INFORMATION";
11925 const EXTRA_CRC: u8 = 49u8;
11926 const ENCODED_LEN: usize = 32usize;
11927 fn deser(
11928 _version: MavlinkVersion,
11929 __input: &[u8],
11930 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11931 let avail_len = __input.len();
11932 let mut payload_buf = [0; Self::ENCODED_LEN];
11933 let mut buf = if avail_len < Self::ENCODED_LEN {
11934 payload_buf[0..avail_len].copy_from_slice(__input);
11935 Bytes::new(&payload_buf)
11936 } else {
11937 Bytes::new(__input)
11938 };
11939 let mut __struct = Self::default();
11940 __struct.arming_time_utc = buf.get_u64_le();
11941 __struct.takeoff_time_utc = buf.get_u64_le();
11942 __struct.flight_uuid = buf.get_u64_le();
11943 __struct.time_boot_ms = buf.get_u32_le();
11944 __struct.landing_time = buf.get_u32_le();
11945 Ok(__struct)
11946 }
11947 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11948 let mut __tmp = BytesMut::new(bytes);
11949 #[allow(clippy::absurd_extreme_comparisons)]
11950 #[allow(unused_comparisons)]
11951 if __tmp.remaining() < Self::ENCODED_LEN {
11952 panic!(
11953 "buffer is too small (need {} bytes, but got {})",
11954 Self::ENCODED_LEN,
11955 __tmp.remaining(),
11956 )
11957 }
11958 __tmp.put_u64_le(self.arming_time_utc);
11959 __tmp.put_u64_le(self.takeoff_time_utc);
11960 __tmp.put_u64_le(self.flight_uuid);
11961 __tmp.put_u32_le(self.time_boot_ms);
11962 if matches!(version, MavlinkVersion::V2) {
11963 __tmp.put_u32_le(self.landing_time);
11964 let len = __tmp.len();
11965 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11966 } else {
11967 __tmp.len()
11968 }
11969 }
11970}
11971#[doc = "Current motion information from a designated system."]
11972#[doc = ""]
11973#[doc = "ID: 144"]
11974#[derive(Debug, Clone, PartialEq)]
11975#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11976#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11977#[cfg_attr(feature = "ts", derive(TS))]
11978#[cfg_attr(feature = "ts", ts(export))]
11979pub struct FOLLOW_TARGET_DATA {
11980 #[doc = "Timestamp (time since system boot)."]
11981 pub timestamp: u64,
11982 #[doc = "button states or switches of a tracker device"]
11983 pub custom_state: u64,
11984 #[doc = "Latitude (WGS84)"]
11985 pub lat: i32,
11986 #[doc = "Longitude (WGS84)"]
11987 pub lon: i32,
11988 #[doc = "Altitude (MSL)"]
11989 pub alt: f32,
11990 #[doc = "target velocity (0,0,0) for unknown"]
11991 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11992 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11993 pub vel: [f32; 3],
11994 #[doc = "linear target acceleration (0,0,0) for unknown"]
11995 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11996 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11997 pub acc: [f32; 3],
11998 #[doc = "(0 0 0 0 for unknown)"]
11999 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12000 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12001 pub attitude_q: [f32; 4],
12002 #[doc = "(0 0 0 for unknown)"]
12003 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12004 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12005 pub rates: [f32; 3],
12006 #[doc = "eph epv"]
12007 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12008 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12009 pub position_cov: [f32; 3],
12010 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12011 pub est_capabilities: u8,
12012}
12013impl FOLLOW_TARGET_DATA {
12014 pub const ENCODED_LEN: usize = 93usize;
12015 pub const DEFAULT: Self = Self {
12016 timestamp: 0_u64,
12017 custom_state: 0_u64,
12018 lat: 0_i32,
12019 lon: 0_i32,
12020 alt: 0.0_f32,
12021 vel: [0.0_f32; 3usize],
12022 acc: [0.0_f32; 3usize],
12023 attitude_q: [0.0_f32; 4usize],
12024 rates: [0.0_f32; 3usize],
12025 position_cov: [0.0_f32; 3usize],
12026 est_capabilities: 0_u8,
12027 };
12028 #[cfg(feature = "arbitrary")]
12029 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12030 use arbitrary::{Arbitrary, Unstructured};
12031 let mut buf = [0u8; 1024];
12032 rng.fill_bytes(&mut buf);
12033 let mut unstructured = Unstructured::new(&buf);
12034 Self::arbitrary(&mut unstructured).unwrap_or_default()
12035 }
12036}
12037impl Default for FOLLOW_TARGET_DATA {
12038 fn default() -> Self {
12039 Self::DEFAULT.clone()
12040 }
12041}
12042impl MessageData for FOLLOW_TARGET_DATA {
12043 type Message = MavMessage;
12044 const ID: u32 = 144u32;
12045 const NAME: &'static str = "FOLLOW_TARGET";
12046 const EXTRA_CRC: u8 = 127u8;
12047 const ENCODED_LEN: usize = 93usize;
12048 fn deser(
12049 _version: MavlinkVersion,
12050 __input: &[u8],
12051 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12052 let avail_len = __input.len();
12053 let mut payload_buf = [0; Self::ENCODED_LEN];
12054 let mut buf = if avail_len < Self::ENCODED_LEN {
12055 payload_buf[0..avail_len].copy_from_slice(__input);
12056 Bytes::new(&payload_buf)
12057 } else {
12058 Bytes::new(__input)
12059 };
12060 let mut __struct = Self::default();
12061 __struct.timestamp = buf.get_u64_le();
12062 __struct.custom_state = buf.get_u64_le();
12063 __struct.lat = buf.get_i32_le();
12064 __struct.lon = buf.get_i32_le();
12065 __struct.alt = buf.get_f32_le();
12066 for v in &mut __struct.vel {
12067 let val = buf.get_f32_le();
12068 *v = val;
12069 }
12070 for v in &mut __struct.acc {
12071 let val = buf.get_f32_le();
12072 *v = val;
12073 }
12074 for v in &mut __struct.attitude_q {
12075 let val = buf.get_f32_le();
12076 *v = val;
12077 }
12078 for v in &mut __struct.rates {
12079 let val = buf.get_f32_le();
12080 *v = val;
12081 }
12082 for v in &mut __struct.position_cov {
12083 let val = buf.get_f32_le();
12084 *v = val;
12085 }
12086 __struct.est_capabilities = buf.get_u8();
12087 Ok(__struct)
12088 }
12089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12090 let mut __tmp = BytesMut::new(bytes);
12091 #[allow(clippy::absurd_extreme_comparisons)]
12092 #[allow(unused_comparisons)]
12093 if __tmp.remaining() < Self::ENCODED_LEN {
12094 panic!(
12095 "buffer is too small (need {} bytes, but got {})",
12096 Self::ENCODED_LEN,
12097 __tmp.remaining(),
12098 )
12099 }
12100 __tmp.put_u64_le(self.timestamp);
12101 __tmp.put_u64_le(self.custom_state);
12102 __tmp.put_i32_le(self.lat);
12103 __tmp.put_i32_le(self.lon);
12104 __tmp.put_f32_le(self.alt);
12105 for val in &self.vel {
12106 __tmp.put_f32_le(*val);
12107 }
12108 for val in &self.acc {
12109 __tmp.put_f32_le(*val);
12110 }
12111 for val in &self.attitude_q {
12112 __tmp.put_f32_le(*val);
12113 }
12114 for val in &self.rates {
12115 __tmp.put_f32_le(*val);
12116 }
12117 for val in &self.position_cov {
12118 __tmp.put_f32_le(*val);
12119 }
12120 __tmp.put_u8(self.est_capabilities);
12121 if matches!(version, MavlinkVersion::V2) {
12122 let len = __tmp.len();
12123 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12124 } else {
12125 __tmp.len()
12126 }
12127 }
12128}
12129#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12130#[doc = ""]
12131#[doc = "ID: 371"]
12132#[derive(Debug, Clone, PartialEq)]
12133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12135#[cfg_attr(feature = "ts", derive(TS))]
12136#[cfg_attr(feature = "ts", ts(export))]
12137pub struct FUEL_STATUS_DATA {
12138 #[doc = "Capacity when full. Must be provided."]
12139 pub maximum_fuel: f32,
12140 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12141 pub consumed_fuel: f32,
12142 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12143 pub remaining_fuel: f32,
12144 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12145 pub flow_rate: f32,
12146 #[doc = "Fuel temperature. NaN: field not provided."]
12147 pub temperature: f32,
12148 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12149 pub fuel_type: MavFuelType,
12150 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12151 pub id: u8,
12152 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12153 pub percent_remaining: u8,
12154}
12155impl FUEL_STATUS_DATA {
12156 pub const ENCODED_LEN: usize = 26usize;
12157 pub const DEFAULT: Self = Self {
12158 maximum_fuel: 0.0_f32,
12159 consumed_fuel: 0.0_f32,
12160 remaining_fuel: 0.0_f32,
12161 flow_rate: 0.0_f32,
12162 temperature: 0.0_f32,
12163 fuel_type: MavFuelType::DEFAULT,
12164 id: 0_u8,
12165 percent_remaining: 0_u8,
12166 };
12167 #[cfg(feature = "arbitrary")]
12168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12169 use arbitrary::{Arbitrary, Unstructured};
12170 let mut buf = [0u8; 1024];
12171 rng.fill_bytes(&mut buf);
12172 let mut unstructured = Unstructured::new(&buf);
12173 Self::arbitrary(&mut unstructured).unwrap_or_default()
12174 }
12175}
12176impl Default for FUEL_STATUS_DATA {
12177 fn default() -> Self {
12178 Self::DEFAULT.clone()
12179 }
12180}
12181impl MessageData for FUEL_STATUS_DATA {
12182 type Message = MavMessage;
12183 const ID: u32 = 371u32;
12184 const NAME: &'static str = "FUEL_STATUS";
12185 const EXTRA_CRC: u8 = 10u8;
12186 const ENCODED_LEN: usize = 26usize;
12187 fn deser(
12188 _version: MavlinkVersion,
12189 __input: &[u8],
12190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12191 let avail_len = __input.len();
12192 let mut payload_buf = [0; Self::ENCODED_LEN];
12193 let mut buf = if avail_len < Self::ENCODED_LEN {
12194 payload_buf[0..avail_len].copy_from_slice(__input);
12195 Bytes::new(&payload_buf)
12196 } else {
12197 Bytes::new(__input)
12198 };
12199 let mut __struct = Self::default();
12200 __struct.maximum_fuel = buf.get_f32_le();
12201 __struct.consumed_fuel = buf.get_f32_le();
12202 __struct.remaining_fuel = buf.get_f32_le();
12203 __struct.flow_rate = buf.get_f32_le();
12204 __struct.temperature = buf.get_f32_le();
12205 let tmp = buf.get_u32_le();
12206 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12207 ::mavlink_core::error::ParserError::InvalidEnum {
12208 enum_type: "MavFuelType",
12209 value: tmp as u32,
12210 },
12211 )?;
12212 __struct.id = buf.get_u8();
12213 __struct.percent_remaining = buf.get_u8();
12214 Ok(__struct)
12215 }
12216 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12217 let mut __tmp = BytesMut::new(bytes);
12218 #[allow(clippy::absurd_extreme_comparisons)]
12219 #[allow(unused_comparisons)]
12220 if __tmp.remaining() < Self::ENCODED_LEN {
12221 panic!(
12222 "buffer is too small (need {} bytes, but got {})",
12223 Self::ENCODED_LEN,
12224 __tmp.remaining(),
12225 )
12226 }
12227 __tmp.put_f32_le(self.maximum_fuel);
12228 __tmp.put_f32_le(self.consumed_fuel);
12229 __tmp.put_f32_le(self.remaining_fuel);
12230 __tmp.put_f32_le(self.flow_rate);
12231 __tmp.put_f32_le(self.temperature);
12232 __tmp.put_u32_le(self.fuel_type as u32);
12233 __tmp.put_u8(self.id);
12234 __tmp.put_u8(self.percent_remaining);
12235 if matches!(version, MavlinkVersion::V2) {
12236 let len = __tmp.len();
12237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12238 } else {
12239 __tmp.len()
12240 }
12241 }
12242}
12243#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12244#[doc = ""]
12245#[doc = "ID: 373"]
12246#[derive(Debug, Clone, PartialEq)]
12247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12249#[cfg_attr(feature = "ts", derive(TS))]
12250#[cfg_attr(feature = "ts", ts(export))]
12251pub struct GENERATOR_STATUS_DATA {
12252 #[doc = "Status flags."]
12253 pub status: MavGeneratorStatusFlag,
12254 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12255 pub battery_current: f32,
12256 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12257 pub load_current: f32,
12258 #[doc = "The power being generated. NaN: field not provided"]
12259 pub power_generated: f32,
12260 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12261 pub bus_voltage: f32,
12262 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12263 pub bat_current_setpoint: f32,
12264 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12265 pub runtime: u32,
12266 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12267 pub time_until_maintenance: i32,
12268 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12269 pub generator_speed: u16,
12270 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12271 pub rectifier_temperature: i16,
12272 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12273 pub generator_temperature: i16,
12274}
12275impl GENERATOR_STATUS_DATA {
12276 pub const ENCODED_LEN: usize = 42usize;
12277 pub const DEFAULT: Self = Self {
12278 status: MavGeneratorStatusFlag::DEFAULT,
12279 battery_current: 0.0_f32,
12280 load_current: 0.0_f32,
12281 power_generated: 0.0_f32,
12282 bus_voltage: 0.0_f32,
12283 bat_current_setpoint: 0.0_f32,
12284 runtime: 0_u32,
12285 time_until_maintenance: 0_i32,
12286 generator_speed: 0_u16,
12287 rectifier_temperature: 0_i16,
12288 generator_temperature: 0_i16,
12289 };
12290 #[cfg(feature = "arbitrary")]
12291 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12292 use arbitrary::{Arbitrary, Unstructured};
12293 let mut buf = [0u8; 1024];
12294 rng.fill_bytes(&mut buf);
12295 let mut unstructured = Unstructured::new(&buf);
12296 Self::arbitrary(&mut unstructured).unwrap_or_default()
12297 }
12298}
12299impl Default for GENERATOR_STATUS_DATA {
12300 fn default() -> Self {
12301 Self::DEFAULT.clone()
12302 }
12303}
12304impl MessageData for GENERATOR_STATUS_DATA {
12305 type Message = MavMessage;
12306 const ID: u32 = 373u32;
12307 const NAME: &'static str = "GENERATOR_STATUS";
12308 const EXTRA_CRC: u8 = 117u8;
12309 const ENCODED_LEN: usize = 42usize;
12310 fn deser(
12311 _version: MavlinkVersion,
12312 __input: &[u8],
12313 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12314 let avail_len = __input.len();
12315 let mut payload_buf = [0; Self::ENCODED_LEN];
12316 let mut buf = if avail_len < Self::ENCODED_LEN {
12317 payload_buf[0..avail_len].copy_from_slice(__input);
12318 Bytes::new(&payload_buf)
12319 } else {
12320 Bytes::new(__input)
12321 };
12322 let mut __struct = Self::default();
12323 let tmp = buf.get_u64_le();
12324 __struct.status = MavGeneratorStatusFlag::from_bits(
12325 tmp & MavGeneratorStatusFlag::all().bits(),
12326 )
12327 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12328 flag_type: "MavGeneratorStatusFlag",
12329 value: tmp as u32,
12330 })?;
12331 __struct.battery_current = buf.get_f32_le();
12332 __struct.load_current = buf.get_f32_le();
12333 __struct.power_generated = buf.get_f32_le();
12334 __struct.bus_voltage = buf.get_f32_le();
12335 __struct.bat_current_setpoint = buf.get_f32_le();
12336 __struct.runtime = buf.get_u32_le();
12337 __struct.time_until_maintenance = buf.get_i32_le();
12338 __struct.generator_speed = buf.get_u16_le();
12339 __struct.rectifier_temperature = buf.get_i16_le();
12340 __struct.generator_temperature = buf.get_i16_le();
12341 Ok(__struct)
12342 }
12343 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12344 let mut __tmp = BytesMut::new(bytes);
12345 #[allow(clippy::absurd_extreme_comparisons)]
12346 #[allow(unused_comparisons)]
12347 if __tmp.remaining() < Self::ENCODED_LEN {
12348 panic!(
12349 "buffer is too small (need {} bytes, but got {})",
12350 Self::ENCODED_LEN,
12351 __tmp.remaining(),
12352 )
12353 }
12354 __tmp.put_u64_le(self.status.bits());
12355 __tmp.put_f32_le(self.battery_current);
12356 __tmp.put_f32_le(self.load_current);
12357 __tmp.put_f32_le(self.power_generated);
12358 __tmp.put_f32_le(self.bus_voltage);
12359 __tmp.put_f32_le(self.bat_current_setpoint);
12360 __tmp.put_u32_le(self.runtime);
12361 __tmp.put_i32_le(self.time_until_maintenance);
12362 __tmp.put_u16_le(self.generator_speed);
12363 __tmp.put_i16_le(self.rectifier_temperature);
12364 __tmp.put_i16_le(self.generator_temperature);
12365 if matches!(version, MavlinkVersion::V2) {
12366 let len = __tmp.len();
12367 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12368 } else {
12369 __tmp.len()
12370 }
12371 }
12372}
12373#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12374#[doc = ""]
12375#[doc = "ID: 285"]
12376#[derive(Debug, Clone, PartialEq)]
12377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12379#[cfg_attr(feature = "ts", derive(TS))]
12380#[cfg_attr(feature = "ts", ts(export))]
12381pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12382 #[doc = "Timestamp (time since system boot)."]
12383 pub time_boot_ms: u32,
12384 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12385 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12386 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12387 pub q: [f32; 4],
12388 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12389 pub angular_velocity_x: f32,
12390 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12391 pub angular_velocity_y: f32,
12392 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12393 pub angular_velocity_z: f32,
12394 #[doc = "Failure flags (0 for no failure)"]
12395 pub failure_flags: GimbalDeviceErrorFlags,
12396 #[doc = "Current gimbal flags set."]
12397 pub flags: GimbalDeviceFlags,
12398 #[doc = "System ID"]
12399 pub target_system: u8,
12400 #[doc = "Component ID"]
12401 pub target_component: u8,
12402 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12403 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12404 pub delta_yaw: f32,
12405 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12406 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12407 pub delta_yaw_velocity: f32,
12408 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12409 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12410 pub gimbal_device_id: u8,
12411}
12412impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12413 pub const ENCODED_LEN: usize = 49usize;
12414 pub const DEFAULT: Self = Self {
12415 time_boot_ms: 0_u32,
12416 q: [0.0_f32; 4usize],
12417 angular_velocity_x: 0.0_f32,
12418 angular_velocity_y: 0.0_f32,
12419 angular_velocity_z: 0.0_f32,
12420 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12421 flags: GimbalDeviceFlags::DEFAULT,
12422 target_system: 0_u8,
12423 target_component: 0_u8,
12424 delta_yaw: 0.0_f32,
12425 delta_yaw_velocity: 0.0_f32,
12426 gimbal_device_id: 0_u8,
12427 };
12428 #[cfg(feature = "arbitrary")]
12429 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12430 use arbitrary::{Arbitrary, Unstructured};
12431 let mut buf = [0u8; 1024];
12432 rng.fill_bytes(&mut buf);
12433 let mut unstructured = Unstructured::new(&buf);
12434 Self::arbitrary(&mut unstructured).unwrap_or_default()
12435 }
12436}
12437impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12438 fn default() -> Self {
12439 Self::DEFAULT.clone()
12440 }
12441}
12442impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12443 type Message = MavMessage;
12444 const ID: u32 = 285u32;
12445 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12446 const EXTRA_CRC: u8 = 137u8;
12447 const ENCODED_LEN: usize = 49usize;
12448 fn deser(
12449 _version: MavlinkVersion,
12450 __input: &[u8],
12451 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12452 let avail_len = __input.len();
12453 let mut payload_buf = [0; Self::ENCODED_LEN];
12454 let mut buf = if avail_len < Self::ENCODED_LEN {
12455 payload_buf[0..avail_len].copy_from_slice(__input);
12456 Bytes::new(&payload_buf)
12457 } else {
12458 Bytes::new(__input)
12459 };
12460 let mut __struct = Self::default();
12461 __struct.time_boot_ms = buf.get_u32_le();
12462 for v in &mut __struct.q {
12463 let val = buf.get_f32_le();
12464 *v = val;
12465 }
12466 __struct.angular_velocity_x = buf.get_f32_le();
12467 __struct.angular_velocity_y = buf.get_f32_le();
12468 __struct.angular_velocity_z = buf.get_f32_le();
12469 let tmp = buf.get_u32_le();
12470 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12471 tmp & GimbalDeviceErrorFlags::all().bits(),
12472 )
12473 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12474 flag_type: "GimbalDeviceErrorFlags",
12475 value: tmp as u32,
12476 })?;
12477 let tmp = buf.get_u16_le();
12478 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12479 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12480 flag_type: "GimbalDeviceFlags",
12481 value: tmp as u32,
12482 })?;
12483 __struct.target_system = buf.get_u8();
12484 __struct.target_component = buf.get_u8();
12485 __struct.delta_yaw = buf.get_f32_le();
12486 __struct.delta_yaw_velocity = buf.get_f32_le();
12487 __struct.gimbal_device_id = buf.get_u8();
12488 Ok(__struct)
12489 }
12490 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12491 let mut __tmp = BytesMut::new(bytes);
12492 #[allow(clippy::absurd_extreme_comparisons)]
12493 #[allow(unused_comparisons)]
12494 if __tmp.remaining() < Self::ENCODED_LEN {
12495 panic!(
12496 "buffer is too small (need {} bytes, but got {})",
12497 Self::ENCODED_LEN,
12498 __tmp.remaining(),
12499 )
12500 }
12501 __tmp.put_u32_le(self.time_boot_ms);
12502 for val in &self.q {
12503 __tmp.put_f32_le(*val);
12504 }
12505 __tmp.put_f32_le(self.angular_velocity_x);
12506 __tmp.put_f32_le(self.angular_velocity_y);
12507 __tmp.put_f32_le(self.angular_velocity_z);
12508 __tmp.put_u32_le(self.failure_flags.bits());
12509 __tmp.put_u16_le(self.flags.bits());
12510 __tmp.put_u8(self.target_system);
12511 __tmp.put_u8(self.target_component);
12512 if matches!(version, MavlinkVersion::V2) {
12513 __tmp.put_f32_le(self.delta_yaw);
12514 __tmp.put_f32_le(self.delta_yaw_velocity);
12515 __tmp.put_u8(self.gimbal_device_id);
12516 let len = __tmp.len();
12517 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12518 } else {
12519 __tmp.len()
12520 }
12521 }
12522}
12523#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12524#[doc = ""]
12525#[doc = "ID: 283"]
12526#[derive(Debug, Clone, PartialEq)]
12527#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12528#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12529#[cfg_attr(feature = "ts", derive(TS))]
12530#[cfg_attr(feature = "ts", ts(export))]
12531pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12532 #[doc = "UID of gimbal hardware (0 if unknown)."]
12533 pub uid: u64,
12534 #[doc = "Timestamp (time since system boot)."]
12535 pub time_boot_ms: u32,
12536 #[doc = "0xff)."]
12537 pub firmware_version: u32,
12538 #[doc = "0xff)."]
12539 pub hardware_version: u32,
12540 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12541 pub roll_min: f32,
12542 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12543 pub roll_max: f32,
12544 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12545 pub pitch_min: f32,
12546 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12547 pub pitch_max: f32,
12548 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12549 pub yaw_min: f32,
12550 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12551 pub yaw_max: f32,
12552 #[doc = "Bitmap of gimbal capability flags."]
12553 pub cap_flags: GimbalDeviceCapFlags,
12554 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12555 pub custom_cap_flags: u16,
12556 #[doc = "Name of the gimbal vendor."]
12557 #[cfg_attr(
12558 feature = "serde",
12559 serde(
12560 serialize_with = "crate::nulstr::serialize::<_, 32>",
12561 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
12562 )
12563 )]
12564 #[cfg_attr(feature = "ts", ts(type = "string"))]
12565 pub vendor_name: [u8; 32],
12566 #[doc = "Name of the gimbal model."]
12567 #[cfg_attr(
12568 feature = "serde",
12569 serde(
12570 serialize_with = "crate::nulstr::serialize::<_, 32>",
12571 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
12572 )
12573 )]
12574 #[cfg_attr(feature = "ts", ts(type = "string"))]
12575 pub model_name: [u8; 32],
12576 #[doc = "Custom name of the gimbal given to it by the user."]
12577 #[cfg_attr(
12578 feature = "serde",
12579 serde(
12580 serialize_with = "crate::nulstr::serialize::<_, 32>",
12581 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
12582 )
12583 )]
12584 #[cfg_attr(feature = "ts", ts(type = "string"))]
12585 pub custom_name: [u8; 32],
12586 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12587 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12588 pub gimbal_device_id: u8,
12589}
12590impl GIMBAL_DEVICE_INFORMATION_DATA {
12591 pub const ENCODED_LEN: usize = 145usize;
12592 pub const DEFAULT: Self = Self {
12593 uid: 0_u64,
12594 time_boot_ms: 0_u32,
12595 firmware_version: 0_u32,
12596 hardware_version: 0_u32,
12597 roll_min: 0.0_f32,
12598 roll_max: 0.0_f32,
12599 pitch_min: 0.0_f32,
12600 pitch_max: 0.0_f32,
12601 yaw_min: 0.0_f32,
12602 yaw_max: 0.0_f32,
12603 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12604 custom_cap_flags: 0_u16,
12605 vendor_name: [0_u8; 32usize],
12606 model_name: [0_u8; 32usize],
12607 custom_name: [0_u8; 32usize],
12608 gimbal_device_id: 0_u8,
12609 };
12610 #[cfg(feature = "arbitrary")]
12611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12612 use arbitrary::{Arbitrary, Unstructured};
12613 let mut buf = [0u8; 1024];
12614 rng.fill_bytes(&mut buf);
12615 let mut unstructured = Unstructured::new(&buf);
12616 Self::arbitrary(&mut unstructured).unwrap_or_default()
12617 }
12618}
12619impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12620 fn default() -> Self {
12621 Self::DEFAULT.clone()
12622 }
12623}
12624impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12625 type Message = MavMessage;
12626 const ID: u32 = 283u32;
12627 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12628 const EXTRA_CRC: u8 = 74u8;
12629 const ENCODED_LEN: usize = 145usize;
12630 fn deser(
12631 _version: MavlinkVersion,
12632 __input: &[u8],
12633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12634 let avail_len = __input.len();
12635 let mut payload_buf = [0; Self::ENCODED_LEN];
12636 let mut buf = if avail_len < Self::ENCODED_LEN {
12637 payload_buf[0..avail_len].copy_from_slice(__input);
12638 Bytes::new(&payload_buf)
12639 } else {
12640 Bytes::new(__input)
12641 };
12642 let mut __struct = Self::default();
12643 __struct.uid = buf.get_u64_le();
12644 __struct.time_boot_ms = buf.get_u32_le();
12645 __struct.firmware_version = buf.get_u32_le();
12646 __struct.hardware_version = buf.get_u32_le();
12647 __struct.roll_min = buf.get_f32_le();
12648 __struct.roll_max = buf.get_f32_le();
12649 __struct.pitch_min = buf.get_f32_le();
12650 __struct.pitch_max = buf.get_f32_le();
12651 __struct.yaw_min = buf.get_f32_le();
12652 __struct.yaw_max = buf.get_f32_le();
12653 let tmp = buf.get_u16_le();
12654 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12655 tmp & GimbalDeviceCapFlags::all().bits(),
12656 )
12657 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12658 flag_type: "GimbalDeviceCapFlags",
12659 value: tmp as u32,
12660 })?;
12661 __struct.custom_cap_flags = buf.get_u16_le();
12662 for v in &mut __struct.vendor_name {
12663 let val = buf.get_u8();
12664 *v = val;
12665 }
12666 for v in &mut __struct.model_name {
12667 let val = buf.get_u8();
12668 *v = val;
12669 }
12670 for v in &mut __struct.custom_name {
12671 let val = buf.get_u8();
12672 *v = val;
12673 }
12674 __struct.gimbal_device_id = buf.get_u8();
12675 Ok(__struct)
12676 }
12677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12678 let mut __tmp = BytesMut::new(bytes);
12679 #[allow(clippy::absurd_extreme_comparisons)]
12680 #[allow(unused_comparisons)]
12681 if __tmp.remaining() < Self::ENCODED_LEN {
12682 panic!(
12683 "buffer is too small (need {} bytes, but got {})",
12684 Self::ENCODED_LEN,
12685 __tmp.remaining(),
12686 )
12687 }
12688 __tmp.put_u64_le(self.uid);
12689 __tmp.put_u32_le(self.time_boot_ms);
12690 __tmp.put_u32_le(self.firmware_version);
12691 __tmp.put_u32_le(self.hardware_version);
12692 __tmp.put_f32_le(self.roll_min);
12693 __tmp.put_f32_le(self.roll_max);
12694 __tmp.put_f32_le(self.pitch_min);
12695 __tmp.put_f32_le(self.pitch_max);
12696 __tmp.put_f32_le(self.yaw_min);
12697 __tmp.put_f32_le(self.yaw_max);
12698 __tmp.put_u16_le(self.cap_flags.bits());
12699 __tmp.put_u16_le(self.custom_cap_flags);
12700 for val in &self.vendor_name {
12701 __tmp.put_u8(*val);
12702 }
12703 for val in &self.model_name {
12704 __tmp.put_u8(*val);
12705 }
12706 for val in &self.custom_name {
12707 __tmp.put_u8(*val);
12708 }
12709 if matches!(version, MavlinkVersion::V2) {
12710 __tmp.put_u8(self.gimbal_device_id);
12711 let len = __tmp.len();
12712 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12713 } else {
12714 __tmp.len()
12715 }
12716 }
12717}
12718#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12719#[doc = ""]
12720#[doc = "ID: 284"]
12721#[derive(Debug, Clone, PartialEq)]
12722#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12723#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12724#[cfg_attr(feature = "ts", derive(TS))]
12725#[cfg_attr(feature = "ts", ts(export))]
12726pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12727 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12728 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12729 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12730 pub q: [f32; 4],
12731 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12732 pub angular_velocity_x: f32,
12733 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12734 pub angular_velocity_y: f32,
12735 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12736 pub angular_velocity_z: f32,
12737 #[doc = "Low level gimbal flags."]
12738 pub flags: GimbalDeviceFlags,
12739 #[doc = "System ID"]
12740 pub target_system: u8,
12741 #[doc = "Component ID"]
12742 pub target_component: u8,
12743}
12744impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12745 pub const ENCODED_LEN: usize = 32usize;
12746 pub const DEFAULT: Self = Self {
12747 q: [0.0_f32; 4usize],
12748 angular_velocity_x: 0.0_f32,
12749 angular_velocity_y: 0.0_f32,
12750 angular_velocity_z: 0.0_f32,
12751 flags: GimbalDeviceFlags::DEFAULT,
12752 target_system: 0_u8,
12753 target_component: 0_u8,
12754 };
12755 #[cfg(feature = "arbitrary")]
12756 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12757 use arbitrary::{Arbitrary, Unstructured};
12758 let mut buf = [0u8; 1024];
12759 rng.fill_bytes(&mut buf);
12760 let mut unstructured = Unstructured::new(&buf);
12761 Self::arbitrary(&mut unstructured).unwrap_or_default()
12762 }
12763}
12764impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12765 fn default() -> Self {
12766 Self::DEFAULT.clone()
12767 }
12768}
12769impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12770 type Message = MavMessage;
12771 const ID: u32 = 284u32;
12772 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12773 const EXTRA_CRC: u8 = 99u8;
12774 const ENCODED_LEN: usize = 32usize;
12775 fn deser(
12776 _version: MavlinkVersion,
12777 __input: &[u8],
12778 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12779 let avail_len = __input.len();
12780 let mut payload_buf = [0; Self::ENCODED_LEN];
12781 let mut buf = if avail_len < Self::ENCODED_LEN {
12782 payload_buf[0..avail_len].copy_from_slice(__input);
12783 Bytes::new(&payload_buf)
12784 } else {
12785 Bytes::new(__input)
12786 };
12787 let mut __struct = Self::default();
12788 for v in &mut __struct.q {
12789 let val = buf.get_f32_le();
12790 *v = val;
12791 }
12792 __struct.angular_velocity_x = buf.get_f32_le();
12793 __struct.angular_velocity_y = buf.get_f32_le();
12794 __struct.angular_velocity_z = buf.get_f32_le();
12795 let tmp = buf.get_u16_le();
12796 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12797 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12798 flag_type: "GimbalDeviceFlags",
12799 value: tmp as u32,
12800 })?;
12801 __struct.target_system = buf.get_u8();
12802 __struct.target_component = buf.get_u8();
12803 Ok(__struct)
12804 }
12805 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12806 let mut __tmp = BytesMut::new(bytes);
12807 #[allow(clippy::absurd_extreme_comparisons)]
12808 #[allow(unused_comparisons)]
12809 if __tmp.remaining() < Self::ENCODED_LEN {
12810 panic!(
12811 "buffer is too small (need {} bytes, but got {})",
12812 Self::ENCODED_LEN,
12813 __tmp.remaining(),
12814 )
12815 }
12816 for val in &self.q {
12817 __tmp.put_f32_le(*val);
12818 }
12819 __tmp.put_f32_le(self.angular_velocity_x);
12820 __tmp.put_f32_le(self.angular_velocity_y);
12821 __tmp.put_f32_le(self.angular_velocity_z);
12822 __tmp.put_u16_le(self.flags.bits());
12823 __tmp.put_u8(self.target_system);
12824 __tmp.put_u8(self.target_component);
12825 if matches!(version, MavlinkVersion::V2) {
12826 let len = __tmp.len();
12827 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12828 } else {
12829 __tmp.len()
12830 }
12831 }
12832}
12833#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12834#[doc = ""]
12835#[doc = "ID: 280"]
12836#[derive(Debug, Clone, PartialEq)]
12837#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12839#[cfg_attr(feature = "ts", derive(TS))]
12840#[cfg_attr(feature = "ts", ts(export))]
12841pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12842 #[doc = "Timestamp (time since system boot)."]
12843 pub time_boot_ms: u32,
12844 #[doc = "Bitmap of gimbal capability flags."]
12845 pub cap_flags: GimbalManagerCapFlags,
12846 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12847 pub roll_min: f32,
12848 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12849 pub roll_max: f32,
12850 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12851 pub pitch_min: f32,
12852 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12853 pub pitch_max: f32,
12854 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12855 pub yaw_min: f32,
12856 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12857 pub yaw_max: f32,
12858 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12859 pub gimbal_device_id: u8,
12860}
12861impl GIMBAL_MANAGER_INFORMATION_DATA {
12862 pub const ENCODED_LEN: usize = 33usize;
12863 pub const DEFAULT: Self = Self {
12864 time_boot_ms: 0_u32,
12865 cap_flags: GimbalManagerCapFlags::DEFAULT,
12866 roll_min: 0.0_f32,
12867 roll_max: 0.0_f32,
12868 pitch_min: 0.0_f32,
12869 pitch_max: 0.0_f32,
12870 yaw_min: 0.0_f32,
12871 yaw_max: 0.0_f32,
12872 gimbal_device_id: 0_u8,
12873 };
12874 #[cfg(feature = "arbitrary")]
12875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12876 use arbitrary::{Arbitrary, Unstructured};
12877 let mut buf = [0u8; 1024];
12878 rng.fill_bytes(&mut buf);
12879 let mut unstructured = Unstructured::new(&buf);
12880 Self::arbitrary(&mut unstructured).unwrap_or_default()
12881 }
12882}
12883impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12884 fn default() -> Self {
12885 Self::DEFAULT.clone()
12886 }
12887}
12888impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12889 type Message = MavMessage;
12890 const ID: u32 = 280u32;
12891 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12892 const EXTRA_CRC: u8 = 70u8;
12893 const ENCODED_LEN: usize = 33usize;
12894 fn deser(
12895 _version: MavlinkVersion,
12896 __input: &[u8],
12897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12898 let avail_len = __input.len();
12899 let mut payload_buf = [0; Self::ENCODED_LEN];
12900 let mut buf = if avail_len < Self::ENCODED_LEN {
12901 payload_buf[0..avail_len].copy_from_slice(__input);
12902 Bytes::new(&payload_buf)
12903 } else {
12904 Bytes::new(__input)
12905 };
12906 let mut __struct = Self::default();
12907 __struct.time_boot_ms = buf.get_u32_le();
12908 let tmp = buf.get_u32_le();
12909 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12910 tmp & GimbalManagerCapFlags::all().bits(),
12911 )
12912 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12913 flag_type: "GimbalManagerCapFlags",
12914 value: tmp as u32,
12915 })?;
12916 __struct.roll_min = buf.get_f32_le();
12917 __struct.roll_max = buf.get_f32_le();
12918 __struct.pitch_min = buf.get_f32_le();
12919 __struct.pitch_max = buf.get_f32_le();
12920 __struct.yaw_min = buf.get_f32_le();
12921 __struct.yaw_max = buf.get_f32_le();
12922 __struct.gimbal_device_id = buf.get_u8();
12923 Ok(__struct)
12924 }
12925 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12926 let mut __tmp = BytesMut::new(bytes);
12927 #[allow(clippy::absurd_extreme_comparisons)]
12928 #[allow(unused_comparisons)]
12929 if __tmp.remaining() < Self::ENCODED_LEN {
12930 panic!(
12931 "buffer is too small (need {} bytes, but got {})",
12932 Self::ENCODED_LEN,
12933 __tmp.remaining(),
12934 )
12935 }
12936 __tmp.put_u32_le(self.time_boot_ms);
12937 __tmp.put_u32_le(self.cap_flags.bits());
12938 __tmp.put_f32_le(self.roll_min);
12939 __tmp.put_f32_le(self.roll_max);
12940 __tmp.put_f32_le(self.pitch_min);
12941 __tmp.put_f32_le(self.pitch_max);
12942 __tmp.put_f32_le(self.yaw_min);
12943 __tmp.put_f32_le(self.yaw_max);
12944 __tmp.put_u8(self.gimbal_device_id);
12945 if matches!(version, MavlinkVersion::V2) {
12946 let len = __tmp.len();
12947 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12948 } else {
12949 __tmp.len()
12950 }
12951 }
12952}
12953#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12954#[doc = ""]
12955#[doc = "ID: 282"]
12956#[derive(Debug, Clone, PartialEq)]
12957#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12958#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12959#[cfg_attr(feature = "ts", derive(TS))]
12960#[cfg_attr(feature = "ts", ts(export))]
12961pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12962 #[doc = "High level gimbal manager flags to use."]
12963 pub flags: GimbalManagerFlags,
12964 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12965 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12966 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12967 pub q: [f32; 4],
12968 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12969 pub angular_velocity_x: f32,
12970 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12971 pub angular_velocity_y: f32,
12972 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12973 pub angular_velocity_z: f32,
12974 #[doc = "System ID"]
12975 pub target_system: u8,
12976 #[doc = "Component ID"]
12977 pub target_component: u8,
12978 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12979 pub gimbal_device_id: u8,
12980}
12981impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12982 pub const ENCODED_LEN: usize = 35usize;
12983 pub const DEFAULT: Self = Self {
12984 flags: GimbalManagerFlags::DEFAULT,
12985 q: [0.0_f32; 4usize],
12986 angular_velocity_x: 0.0_f32,
12987 angular_velocity_y: 0.0_f32,
12988 angular_velocity_z: 0.0_f32,
12989 target_system: 0_u8,
12990 target_component: 0_u8,
12991 gimbal_device_id: 0_u8,
12992 };
12993 #[cfg(feature = "arbitrary")]
12994 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12995 use arbitrary::{Arbitrary, Unstructured};
12996 let mut buf = [0u8; 1024];
12997 rng.fill_bytes(&mut buf);
12998 let mut unstructured = Unstructured::new(&buf);
12999 Self::arbitrary(&mut unstructured).unwrap_or_default()
13000 }
13001}
13002impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13003 fn default() -> Self {
13004 Self::DEFAULT.clone()
13005 }
13006}
13007impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13008 type Message = MavMessage;
13009 const ID: u32 = 282u32;
13010 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13011 const EXTRA_CRC: u8 = 123u8;
13012 const ENCODED_LEN: usize = 35usize;
13013 fn deser(
13014 _version: MavlinkVersion,
13015 __input: &[u8],
13016 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13017 let avail_len = __input.len();
13018 let mut payload_buf = [0; Self::ENCODED_LEN];
13019 let mut buf = if avail_len < Self::ENCODED_LEN {
13020 payload_buf[0..avail_len].copy_from_slice(__input);
13021 Bytes::new(&payload_buf)
13022 } else {
13023 Bytes::new(__input)
13024 };
13025 let mut __struct = Self::default();
13026 let tmp = buf.get_u32_le();
13027 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13028 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13029 flag_type: "GimbalManagerFlags",
13030 value: tmp as u32,
13031 })?;
13032 for v in &mut __struct.q {
13033 let val = buf.get_f32_le();
13034 *v = val;
13035 }
13036 __struct.angular_velocity_x = buf.get_f32_le();
13037 __struct.angular_velocity_y = buf.get_f32_le();
13038 __struct.angular_velocity_z = buf.get_f32_le();
13039 __struct.target_system = buf.get_u8();
13040 __struct.target_component = buf.get_u8();
13041 __struct.gimbal_device_id = buf.get_u8();
13042 Ok(__struct)
13043 }
13044 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13045 let mut __tmp = BytesMut::new(bytes);
13046 #[allow(clippy::absurd_extreme_comparisons)]
13047 #[allow(unused_comparisons)]
13048 if __tmp.remaining() < Self::ENCODED_LEN {
13049 panic!(
13050 "buffer is too small (need {} bytes, but got {})",
13051 Self::ENCODED_LEN,
13052 __tmp.remaining(),
13053 )
13054 }
13055 __tmp.put_u32_le(self.flags.bits());
13056 for val in &self.q {
13057 __tmp.put_f32_le(*val);
13058 }
13059 __tmp.put_f32_le(self.angular_velocity_x);
13060 __tmp.put_f32_le(self.angular_velocity_y);
13061 __tmp.put_f32_le(self.angular_velocity_z);
13062 __tmp.put_u8(self.target_system);
13063 __tmp.put_u8(self.target_component);
13064 __tmp.put_u8(self.gimbal_device_id);
13065 if matches!(version, MavlinkVersion::V2) {
13066 let len = __tmp.len();
13067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13068 } else {
13069 __tmp.len()
13070 }
13071 }
13072}
13073#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13074#[doc = ""]
13075#[doc = "ID: 288"]
13076#[derive(Debug, Clone, PartialEq)]
13077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13079#[cfg_attr(feature = "ts", derive(TS))]
13080#[cfg_attr(feature = "ts", ts(export))]
13081pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13082 #[doc = "High level gimbal manager flags."]
13083 pub flags: GimbalManagerFlags,
13084 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13085 pub pitch: f32,
13086 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13087 pub yaw: f32,
13088 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13089 pub pitch_rate: f32,
13090 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13091 pub yaw_rate: f32,
13092 #[doc = "System ID"]
13093 pub target_system: u8,
13094 #[doc = "Component ID"]
13095 pub target_component: u8,
13096 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13097 pub gimbal_device_id: u8,
13098}
13099impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13100 pub const ENCODED_LEN: usize = 23usize;
13101 pub const DEFAULT: Self = Self {
13102 flags: GimbalManagerFlags::DEFAULT,
13103 pitch: 0.0_f32,
13104 yaw: 0.0_f32,
13105 pitch_rate: 0.0_f32,
13106 yaw_rate: 0.0_f32,
13107 target_system: 0_u8,
13108 target_component: 0_u8,
13109 gimbal_device_id: 0_u8,
13110 };
13111 #[cfg(feature = "arbitrary")]
13112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13113 use arbitrary::{Arbitrary, Unstructured};
13114 let mut buf = [0u8; 1024];
13115 rng.fill_bytes(&mut buf);
13116 let mut unstructured = Unstructured::new(&buf);
13117 Self::arbitrary(&mut unstructured).unwrap_or_default()
13118 }
13119}
13120impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13121 fn default() -> Self {
13122 Self::DEFAULT.clone()
13123 }
13124}
13125impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13126 type Message = MavMessage;
13127 const ID: u32 = 288u32;
13128 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13129 const EXTRA_CRC: u8 = 20u8;
13130 const ENCODED_LEN: usize = 23usize;
13131 fn deser(
13132 _version: MavlinkVersion,
13133 __input: &[u8],
13134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13135 let avail_len = __input.len();
13136 let mut payload_buf = [0; Self::ENCODED_LEN];
13137 let mut buf = if avail_len < Self::ENCODED_LEN {
13138 payload_buf[0..avail_len].copy_from_slice(__input);
13139 Bytes::new(&payload_buf)
13140 } else {
13141 Bytes::new(__input)
13142 };
13143 let mut __struct = Self::default();
13144 let tmp = buf.get_u32_le();
13145 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13146 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13147 flag_type: "GimbalManagerFlags",
13148 value: tmp as u32,
13149 })?;
13150 __struct.pitch = buf.get_f32_le();
13151 __struct.yaw = buf.get_f32_le();
13152 __struct.pitch_rate = buf.get_f32_le();
13153 __struct.yaw_rate = buf.get_f32_le();
13154 __struct.target_system = buf.get_u8();
13155 __struct.target_component = buf.get_u8();
13156 __struct.gimbal_device_id = buf.get_u8();
13157 Ok(__struct)
13158 }
13159 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13160 let mut __tmp = BytesMut::new(bytes);
13161 #[allow(clippy::absurd_extreme_comparisons)]
13162 #[allow(unused_comparisons)]
13163 if __tmp.remaining() < Self::ENCODED_LEN {
13164 panic!(
13165 "buffer is too small (need {} bytes, but got {})",
13166 Self::ENCODED_LEN,
13167 __tmp.remaining(),
13168 )
13169 }
13170 __tmp.put_u32_le(self.flags.bits());
13171 __tmp.put_f32_le(self.pitch);
13172 __tmp.put_f32_le(self.yaw);
13173 __tmp.put_f32_le(self.pitch_rate);
13174 __tmp.put_f32_le(self.yaw_rate);
13175 __tmp.put_u8(self.target_system);
13176 __tmp.put_u8(self.target_component);
13177 __tmp.put_u8(self.gimbal_device_id);
13178 if matches!(version, MavlinkVersion::V2) {
13179 let len = __tmp.len();
13180 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13181 } else {
13182 __tmp.len()
13183 }
13184 }
13185}
13186#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13187#[doc = ""]
13188#[doc = "ID: 287"]
13189#[derive(Debug, Clone, PartialEq)]
13190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13192#[cfg_attr(feature = "ts", derive(TS))]
13193#[cfg_attr(feature = "ts", ts(export))]
13194pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13195 #[doc = "High level gimbal manager flags to use."]
13196 pub flags: GimbalManagerFlags,
13197 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13198 pub pitch: f32,
13199 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13200 pub yaw: f32,
13201 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13202 pub pitch_rate: f32,
13203 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13204 pub yaw_rate: f32,
13205 #[doc = "System ID"]
13206 pub target_system: u8,
13207 #[doc = "Component ID"]
13208 pub target_component: u8,
13209 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13210 pub gimbal_device_id: u8,
13211}
13212impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13213 pub const ENCODED_LEN: usize = 23usize;
13214 pub const DEFAULT: Self = Self {
13215 flags: GimbalManagerFlags::DEFAULT,
13216 pitch: 0.0_f32,
13217 yaw: 0.0_f32,
13218 pitch_rate: 0.0_f32,
13219 yaw_rate: 0.0_f32,
13220 target_system: 0_u8,
13221 target_component: 0_u8,
13222 gimbal_device_id: 0_u8,
13223 };
13224 #[cfg(feature = "arbitrary")]
13225 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13226 use arbitrary::{Arbitrary, Unstructured};
13227 let mut buf = [0u8; 1024];
13228 rng.fill_bytes(&mut buf);
13229 let mut unstructured = Unstructured::new(&buf);
13230 Self::arbitrary(&mut unstructured).unwrap_or_default()
13231 }
13232}
13233impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13234 fn default() -> Self {
13235 Self::DEFAULT.clone()
13236 }
13237}
13238impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13239 type Message = MavMessage;
13240 const ID: u32 = 287u32;
13241 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13242 const EXTRA_CRC: u8 = 1u8;
13243 const ENCODED_LEN: usize = 23usize;
13244 fn deser(
13245 _version: MavlinkVersion,
13246 __input: &[u8],
13247 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13248 let avail_len = __input.len();
13249 let mut payload_buf = [0; Self::ENCODED_LEN];
13250 let mut buf = if avail_len < Self::ENCODED_LEN {
13251 payload_buf[0..avail_len].copy_from_slice(__input);
13252 Bytes::new(&payload_buf)
13253 } else {
13254 Bytes::new(__input)
13255 };
13256 let mut __struct = Self::default();
13257 let tmp = buf.get_u32_le();
13258 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13259 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13260 flag_type: "GimbalManagerFlags",
13261 value: tmp as u32,
13262 })?;
13263 __struct.pitch = buf.get_f32_le();
13264 __struct.yaw = buf.get_f32_le();
13265 __struct.pitch_rate = buf.get_f32_le();
13266 __struct.yaw_rate = buf.get_f32_le();
13267 __struct.target_system = buf.get_u8();
13268 __struct.target_component = buf.get_u8();
13269 __struct.gimbal_device_id = buf.get_u8();
13270 Ok(__struct)
13271 }
13272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13273 let mut __tmp = BytesMut::new(bytes);
13274 #[allow(clippy::absurd_extreme_comparisons)]
13275 #[allow(unused_comparisons)]
13276 if __tmp.remaining() < Self::ENCODED_LEN {
13277 panic!(
13278 "buffer is too small (need {} bytes, but got {})",
13279 Self::ENCODED_LEN,
13280 __tmp.remaining(),
13281 )
13282 }
13283 __tmp.put_u32_le(self.flags.bits());
13284 __tmp.put_f32_le(self.pitch);
13285 __tmp.put_f32_le(self.yaw);
13286 __tmp.put_f32_le(self.pitch_rate);
13287 __tmp.put_f32_le(self.yaw_rate);
13288 __tmp.put_u8(self.target_system);
13289 __tmp.put_u8(self.target_component);
13290 __tmp.put_u8(self.gimbal_device_id);
13291 if matches!(version, MavlinkVersion::V2) {
13292 let len = __tmp.len();
13293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13294 } else {
13295 __tmp.len()
13296 }
13297 }
13298}
13299#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13300#[doc = ""]
13301#[doc = "ID: 281"]
13302#[derive(Debug, Clone, PartialEq)]
13303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13305#[cfg_attr(feature = "ts", derive(TS))]
13306#[cfg_attr(feature = "ts", ts(export))]
13307pub struct GIMBAL_MANAGER_STATUS_DATA {
13308 #[doc = "Timestamp (time since system boot)."]
13309 pub time_boot_ms: u32,
13310 #[doc = "High level gimbal manager flags currently applied."]
13311 pub flags: GimbalManagerFlags,
13312 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13313 pub gimbal_device_id: u8,
13314 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13315 pub primary_control_sysid: u8,
13316 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13317 pub primary_control_compid: u8,
13318 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13319 pub secondary_control_sysid: u8,
13320 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13321 pub secondary_control_compid: u8,
13322}
13323impl GIMBAL_MANAGER_STATUS_DATA {
13324 pub const ENCODED_LEN: usize = 13usize;
13325 pub const DEFAULT: Self = Self {
13326 time_boot_ms: 0_u32,
13327 flags: GimbalManagerFlags::DEFAULT,
13328 gimbal_device_id: 0_u8,
13329 primary_control_sysid: 0_u8,
13330 primary_control_compid: 0_u8,
13331 secondary_control_sysid: 0_u8,
13332 secondary_control_compid: 0_u8,
13333 };
13334 #[cfg(feature = "arbitrary")]
13335 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13336 use arbitrary::{Arbitrary, Unstructured};
13337 let mut buf = [0u8; 1024];
13338 rng.fill_bytes(&mut buf);
13339 let mut unstructured = Unstructured::new(&buf);
13340 Self::arbitrary(&mut unstructured).unwrap_or_default()
13341 }
13342}
13343impl Default for GIMBAL_MANAGER_STATUS_DATA {
13344 fn default() -> Self {
13345 Self::DEFAULT.clone()
13346 }
13347}
13348impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13349 type Message = MavMessage;
13350 const ID: u32 = 281u32;
13351 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13352 const EXTRA_CRC: u8 = 48u8;
13353 const ENCODED_LEN: usize = 13usize;
13354 fn deser(
13355 _version: MavlinkVersion,
13356 __input: &[u8],
13357 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13358 let avail_len = __input.len();
13359 let mut payload_buf = [0; Self::ENCODED_LEN];
13360 let mut buf = if avail_len < Self::ENCODED_LEN {
13361 payload_buf[0..avail_len].copy_from_slice(__input);
13362 Bytes::new(&payload_buf)
13363 } else {
13364 Bytes::new(__input)
13365 };
13366 let mut __struct = Self::default();
13367 __struct.time_boot_ms = buf.get_u32_le();
13368 let tmp = buf.get_u32_le();
13369 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13370 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13371 flag_type: "GimbalManagerFlags",
13372 value: tmp as u32,
13373 })?;
13374 __struct.gimbal_device_id = buf.get_u8();
13375 __struct.primary_control_sysid = buf.get_u8();
13376 __struct.primary_control_compid = buf.get_u8();
13377 __struct.secondary_control_sysid = buf.get_u8();
13378 __struct.secondary_control_compid = buf.get_u8();
13379 Ok(__struct)
13380 }
13381 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13382 let mut __tmp = BytesMut::new(bytes);
13383 #[allow(clippy::absurd_extreme_comparisons)]
13384 #[allow(unused_comparisons)]
13385 if __tmp.remaining() < Self::ENCODED_LEN {
13386 panic!(
13387 "buffer is too small (need {} bytes, but got {})",
13388 Self::ENCODED_LEN,
13389 __tmp.remaining(),
13390 )
13391 }
13392 __tmp.put_u32_le(self.time_boot_ms);
13393 __tmp.put_u32_le(self.flags.bits());
13394 __tmp.put_u8(self.gimbal_device_id);
13395 __tmp.put_u8(self.primary_control_sysid);
13396 __tmp.put_u8(self.primary_control_compid);
13397 __tmp.put_u8(self.secondary_control_sysid);
13398 __tmp.put_u8(self.secondary_control_compid);
13399 if matches!(version, MavlinkVersion::V2) {
13400 let len = __tmp.len();
13401 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13402 } else {
13403 __tmp.len()
13404 }
13405 }
13406}
13407#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13408#[doc = ""]
13409#[doc = "ID: 33"]
13410#[derive(Debug, Clone, PartialEq)]
13411#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13412#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13413#[cfg_attr(feature = "ts", derive(TS))]
13414#[cfg_attr(feature = "ts", ts(export))]
13415pub struct GLOBAL_POSITION_INT_DATA {
13416 #[doc = "Timestamp (time since system boot)."]
13417 pub time_boot_ms: u32,
13418 #[doc = "Latitude, expressed"]
13419 pub lat: i32,
13420 #[doc = "Longitude, expressed"]
13421 pub lon: i32,
13422 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13423 pub alt: i32,
13424 #[doc = "Altitude above home"]
13425 pub relative_alt: i32,
13426 #[doc = "Ground X Speed (Latitude, positive north)"]
13427 pub vx: i16,
13428 #[doc = "Ground Y Speed (Longitude, positive east)"]
13429 pub vy: i16,
13430 #[doc = "Ground Z Speed (Altitude, positive down)"]
13431 pub vz: i16,
13432 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13433 pub hdg: u16,
13434}
13435impl GLOBAL_POSITION_INT_DATA {
13436 pub const ENCODED_LEN: usize = 28usize;
13437 pub const DEFAULT: Self = Self {
13438 time_boot_ms: 0_u32,
13439 lat: 0_i32,
13440 lon: 0_i32,
13441 alt: 0_i32,
13442 relative_alt: 0_i32,
13443 vx: 0_i16,
13444 vy: 0_i16,
13445 vz: 0_i16,
13446 hdg: 0_u16,
13447 };
13448 #[cfg(feature = "arbitrary")]
13449 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13450 use arbitrary::{Arbitrary, Unstructured};
13451 let mut buf = [0u8; 1024];
13452 rng.fill_bytes(&mut buf);
13453 let mut unstructured = Unstructured::new(&buf);
13454 Self::arbitrary(&mut unstructured).unwrap_or_default()
13455 }
13456}
13457impl Default for GLOBAL_POSITION_INT_DATA {
13458 fn default() -> Self {
13459 Self::DEFAULT.clone()
13460 }
13461}
13462impl MessageData for GLOBAL_POSITION_INT_DATA {
13463 type Message = MavMessage;
13464 const ID: u32 = 33u32;
13465 const NAME: &'static str = "GLOBAL_POSITION_INT";
13466 const EXTRA_CRC: u8 = 104u8;
13467 const ENCODED_LEN: usize = 28usize;
13468 fn deser(
13469 _version: MavlinkVersion,
13470 __input: &[u8],
13471 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13472 let avail_len = __input.len();
13473 let mut payload_buf = [0; Self::ENCODED_LEN];
13474 let mut buf = if avail_len < Self::ENCODED_LEN {
13475 payload_buf[0..avail_len].copy_from_slice(__input);
13476 Bytes::new(&payload_buf)
13477 } else {
13478 Bytes::new(__input)
13479 };
13480 let mut __struct = Self::default();
13481 __struct.time_boot_ms = buf.get_u32_le();
13482 __struct.lat = buf.get_i32_le();
13483 __struct.lon = buf.get_i32_le();
13484 __struct.alt = buf.get_i32_le();
13485 __struct.relative_alt = buf.get_i32_le();
13486 __struct.vx = buf.get_i16_le();
13487 __struct.vy = buf.get_i16_le();
13488 __struct.vz = buf.get_i16_le();
13489 __struct.hdg = buf.get_u16_le();
13490 Ok(__struct)
13491 }
13492 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13493 let mut __tmp = BytesMut::new(bytes);
13494 #[allow(clippy::absurd_extreme_comparisons)]
13495 #[allow(unused_comparisons)]
13496 if __tmp.remaining() < Self::ENCODED_LEN {
13497 panic!(
13498 "buffer is too small (need {} bytes, but got {})",
13499 Self::ENCODED_LEN,
13500 __tmp.remaining(),
13501 )
13502 }
13503 __tmp.put_u32_le(self.time_boot_ms);
13504 __tmp.put_i32_le(self.lat);
13505 __tmp.put_i32_le(self.lon);
13506 __tmp.put_i32_le(self.alt);
13507 __tmp.put_i32_le(self.relative_alt);
13508 __tmp.put_i16_le(self.vx);
13509 __tmp.put_i16_le(self.vy);
13510 __tmp.put_i16_le(self.vz);
13511 __tmp.put_u16_le(self.hdg);
13512 if matches!(version, MavlinkVersion::V2) {
13513 let len = __tmp.len();
13514 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13515 } else {
13516 __tmp.len()
13517 }
13518 }
13519}
13520#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13521#[doc = ""]
13522#[doc = "ID: 63"]
13523#[derive(Debug, Clone, PartialEq)]
13524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13526#[cfg_attr(feature = "ts", derive(TS))]
13527#[cfg_attr(feature = "ts", ts(export))]
13528pub struct GLOBAL_POSITION_INT_COV_DATA {
13529 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13530 pub time_usec: u64,
13531 #[doc = "Latitude"]
13532 pub lat: i32,
13533 #[doc = "Longitude"]
13534 pub lon: i32,
13535 #[doc = "Altitude in meters above MSL"]
13536 pub alt: i32,
13537 #[doc = "Altitude above ground"]
13538 pub relative_alt: i32,
13539 #[doc = "Ground X Speed (Latitude)"]
13540 pub vx: f32,
13541 #[doc = "Ground Y Speed (Longitude)"]
13542 pub vy: f32,
13543 #[doc = "Ground Z Speed (Altitude)"]
13544 pub vz: f32,
13545 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13546 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13547 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13548 pub covariance: [f32; 36],
13549 #[doc = "Class id of the estimator this estimate originated from."]
13550 pub estimator_type: MavEstimatorType,
13551}
13552impl GLOBAL_POSITION_INT_COV_DATA {
13553 pub const ENCODED_LEN: usize = 181usize;
13554 pub const DEFAULT: Self = Self {
13555 time_usec: 0_u64,
13556 lat: 0_i32,
13557 lon: 0_i32,
13558 alt: 0_i32,
13559 relative_alt: 0_i32,
13560 vx: 0.0_f32,
13561 vy: 0.0_f32,
13562 vz: 0.0_f32,
13563 covariance: [0.0_f32; 36usize],
13564 estimator_type: MavEstimatorType::DEFAULT,
13565 };
13566 #[cfg(feature = "arbitrary")]
13567 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13568 use arbitrary::{Arbitrary, Unstructured};
13569 let mut buf = [0u8; 1024];
13570 rng.fill_bytes(&mut buf);
13571 let mut unstructured = Unstructured::new(&buf);
13572 Self::arbitrary(&mut unstructured).unwrap_or_default()
13573 }
13574}
13575impl Default for GLOBAL_POSITION_INT_COV_DATA {
13576 fn default() -> Self {
13577 Self::DEFAULT.clone()
13578 }
13579}
13580impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13581 type Message = MavMessage;
13582 const ID: u32 = 63u32;
13583 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13584 const EXTRA_CRC: u8 = 119u8;
13585 const ENCODED_LEN: usize = 181usize;
13586 fn deser(
13587 _version: MavlinkVersion,
13588 __input: &[u8],
13589 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13590 let avail_len = __input.len();
13591 let mut payload_buf = [0; Self::ENCODED_LEN];
13592 let mut buf = if avail_len < Self::ENCODED_LEN {
13593 payload_buf[0..avail_len].copy_from_slice(__input);
13594 Bytes::new(&payload_buf)
13595 } else {
13596 Bytes::new(__input)
13597 };
13598 let mut __struct = Self::default();
13599 __struct.time_usec = buf.get_u64_le();
13600 __struct.lat = buf.get_i32_le();
13601 __struct.lon = buf.get_i32_le();
13602 __struct.alt = buf.get_i32_le();
13603 __struct.relative_alt = buf.get_i32_le();
13604 __struct.vx = buf.get_f32_le();
13605 __struct.vy = buf.get_f32_le();
13606 __struct.vz = buf.get_f32_le();
13607 for v in &mut __struct.covariance {
13608 let val = buf.get_f32_le();
13609 *v = val;
13610 }
13611 let tmp = buf.get_u8();
13612 __struct.estimator_type =
13613 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13614 enum_type: "MavEstimatorType",
13615 value: tmp as u32,
13616 })?;
13617 Ok(__struct)
13618 }
13619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13620 let mut __tmp = BytesMut::new(bytes);
13621 #[allow(clippy::absurd_extreme_comparisons)]
13622 #[allow(unused_comparisons)]
13623 if __tmp.remaining() < Self::ENCODED_LEN {
13624 panic!(
13625 "buffer is too small (need {} bytes, but got {})",
13626 Self::ENCODED_LEN,
13627 __tmp.remaining(),
13628 )
13629 }
13630 __tmp.put_u64_le(self.time_usec);
13631 __tmp.put_i32_le(self.lat);
13632 __tmp.put_i32_le(self.lon);
13633 __tmp.put_i32_le(self.alt);
13634 __tmp.put_i32_le(self.relative_alt);
13635 __tmp.put_f32_le(self.vx);
13636 __tmp.put_f32_le(self.vy);
13637 __tmp.put_f32_le(self.vz);
13638 for val in &self.covariance {
13639 __tmp.put_f32_le(*val);
13640 }
13641 __tmp.put_u8(self.estimator_type as u8);
13642 if matches!(version, MavlinkVersion::V2) {
13643 let len = __tmp.len();
13644 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13645 } else {
13646 __tmp.len()
13647 }
13648 }
13649}
13650#[doc = "Global position/attitude estimate from a vision source."]
13651#[doc = ""]
13652#[doc = "ID: 101"]
13653#[derive(Debug, Clone, PartialEq)]
13654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13655#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13656#[cfg_attr(feature = "ts", derive(TS))]
13657#[cfg_attr(feature = "ts", ts(export))]
13658pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13659 #[doc = "Timestamp (UNIX time or since system boot)"]
13660 pub usec: u64,
13661 #[doc = "Global X position"]
13662 pub x: f32,
13663 #[doc = "Global Y position"]
13664 pub y: f32,
13665 #[doc = "Global Z position"]
13666 pub z: f32,
13667 #[doc = "Roll angle"]
13668 pub roll: f32,
13669 #[doc = "Pitch angle"]
13670 pub pitch: f32,
13671 #[doc = "Yaw angle"]
13672 pub yaw: f32,
13673 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13674 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13675 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13676 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13677 pub covariance: [f32; 21],
13678 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13679 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13680 pub reset_counter: u8,
13681}
13682impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13683 pub const ENCODED_LEN: usize = 117usize;
13684 pub const DEFAULT: Self = Self {
13685 usec: 0_u64,
13686 x: 0.0_f32,
13687 y: 0.0_f32,
13688 z: 0.0_f32,
13689 roll: 0.0_f32,
13690 pitch: 0.0_f32,
13691 yaw: 0.0_f32,
13692 covariance: [0.0_f32; 21usize],
13693 reset_counter: 0_u8,
13694 };
13695 #[cfg(feature = "arbitrary")]
13696 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13697 use arbitrary::{Arbitrary, Unstructured};
13698 let mut buf = [0u8; 1024];
13699 rng.fill_bytes(&mut buf);
13700 let mut unstructured = Unstructured::new(&buf);
13701 Self::arbitrary(&mut unstructured).unwrap_or_default()
13702 }
13703}
13704impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13705 fn default() -> Self {
13706 Self::DEFAULT.clone()
13707 }
13708}
13709impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13710 type Message = MavMessage;
13711 const ID: u32 = 101u32;
13712 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13713 const EXTRA_CRC: u8 = 102u8;
13714 const ENCODED_LEN: usize = 117usize;
13715 fn deser(
13716 _version: MavlinkVersion,
13717 __input: &[u8],
13718 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13719 let avail_len = __input.len();
13720 let mut payload_buf = [0; Self::ENCODED_LEN];
13721 let mut buf = if avail_len < Self::ENCODED_LEN {
13722 payload_buf[0..avail_len].copy_from_slice(__input);
13723 Bytes::new(&payload_buf)
13724 } else {
13725 Bytes::new(__input)
13726 };
13727 let mut __struct = Self::default();
13728 __struct.usec = buf.get_u64_le();
13729 __struct.x = buf.get_f32_le();
13730 __struct.y = buf.get_f32_le();
13731 __struct.z = buf.get_f32_le();
13732 __struct.roll = buf.get_f32_le();
13733 __struct.pitch = buf.get_f32_le();
13734 __struct.yaw = buf.get_f32_le();
13735 for v in &mut __struct.covariance {
13736 let val = buf.get_f32_le();
13737 *v = val;
13738 }
13739 __struct.reset_counter = buf.get_u8();
13740 Ok(__struct)
13741 }
13742 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13743 let mut __tmp = BytesMut::new(bytes);
13744 #[allow(clippy::absurd_extreme_comparisons)]
13745 #[allow(unused_comparisons)]
13746 if __tmp.remaining() < Self::ENCODED_LEN {
13747 panic!(
13748 "buffer is too small (need {} bytes, but got {})",
13749 Self::ENCODED_LEN,
13750 __tmp.remaining(),
13751 )
13752 }
13753 __tmp.put_u64_le(self.usec);
13754 __tmp.put_f32_le(self.x);
13755 __tmp.put_f32_le(self.y);
13756 __tmp.put_f32_le(self.z);
13757 __tmp.put_f32_le(self.roll);
13758 __tmp.put_f32_le(self.pitch);
13759 __tmp.put_f32_le(self.yaw);
13760 if matches!(version, MavlinkVersion::V2) {
13761 for val in &self.covariance {
13762 __tmp.put_f32_le(*val);
13763 }
13764 __tmp.put_u8(self.reset_counter);
13765 let len = __tmp.len();
13766 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13767 } else {
13768 __tmp.len()
13769 }
13770 }
13771}
13772#[doc = "Second GPS data."]
13773#[doc = ""]
13774#[doc = "ID: 124"]
13775#[derive(Debug, Clone, PartialEq)]
13776#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13777#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13778#[cfg_attr(feature = "ts", derive(TS))]
13779#[cfg_attr(feature = "ts", ts(export))]
13780pub struct GPS2_RAW_DATA {
13781 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13782 pub time_usec: u64,
13783 #[doc = "Latitude (WGS84)"]
13784 pub lat: i32,
13785 #[doc = "Longitude (WGS84)"]
13786 pub lon: i32,
13787 #[doc = "Altitude (MSL). Positive for up."]
13788 pub alt: i32,
13789 #[doc = "Age of DGPS info"]
13790 pub dgps_age: u32,
13791 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13792 pub eph: u16,
13793 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13794 pub epv: u16,
13795 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13796 pub vel: u16,
13797 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13798 pub cog: u16,
13799 #[doc = "GPS fix type."]
13800 pub fix_type: GpsFixType,
13801 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13802 pub satellites_visible: u8,
13803 #[doc = "Number of DGPS satellites"]
13804 pub dgps_numch: u8,
13805 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13806 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13807 pub yaw: u16,
13808 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13809 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13810 pub alt_ellipsoid: i32,
13811 #[doc = "Position uncertainty."]
13812 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13813 pub h_acc: u32,
13814 #[doc = "Altitude uncertainty."]
13815 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13816 pub v_acc: u32,
13817 #[doc = "Speed uncertainty."]
13818 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13819 pub vel_acc: u32,
13820 #[doc = "Heading / track uncertainty"]
13821 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13822 pub hdg_acc: u32,
13823}
13824impl GPS2_RAW_DATA {
13825 pub const ENCODED_LEN: usize = 57usize;
13826 pub const DEFAULT: Self = Self {
13827 time_usec: 0_u64,
13828 lat: 0_i32,
13829 lon: 0_i32,
13830 alt: 0_i32,
13831 dgps_age: 0_u32,
13832 eph: 0_u16,
13833 epv: 0_u16,
13834 vel: 0_u16,
13835 cog: 0_u16,
13836 fix_type: GpsFixType::DEFAULT,
13837 satellites_visible: 0_u8,
13838 dgps_numch: 0_u8,
13839 yaw: 0_u16,
13840 alt_ellipsoid: 0_i32,
13841 h_acc: 0_u32,
13842 v_acc: 0_u32,
13843 vel_acc: 0_u32,
13844 hdg_acc: 0_u32,
13845 };
13846 #[cfg(feature = "arbitrary")]
13847 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13848 use arbitrary::{Arbitrary, Unstructured};
13849 let mut buf = [0u8; 1024];
13850 rng.fill_bytes(&mut buf);
13851 let mut unstructured = Unstructured::new(&buf);
13852 Self::arbitrary(&mut unstructured).unwrap_or_default()
13853 }
13854}
13855impl Default for GPS2_RAW_DATA {
13856 fn default() -> Self {
13857 Self::DEFAULT.clone()
13858 }
13859}
13860impl MessageData for GPS2_RAW_DATA {
13861 type Message = MavMessage;
13862 const ID: u32 = 124u32;
13863 const NAME: &'static str = "GPS2_RAW";
13864 const EXTRA_CRC: u8 = 87u8;
13865 const ENCODED_LEN: usize = 57usize;
13866 fn deser(
13867 _version: MavlinkVersion,
13868 __input: &[u8],
13869 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13870 let avail_len = __input.len();
13871 let mut payload_buf = [0; Self::ENCODED_LEN];
13872 let mut buf = if avail_len < Self::ENCODED_LEN {
13873 payload_buf[0..avail_len].copy_from_slice(__input);
13874 Bytes::new(&payload_buf)
13875 } else {
13876 Bytes::new(__input)
13877 };
13878 let mut __struct = Self::default();
13879 __struct.time_usec = buf.get_u64_le();
13880 __struct.lat = buf.get_i32_le();
13881 __struct.lon = buf.get_i32_le();
13882 __struct.alt = buf.get_i32_le();
13883 __struct.dgps_age = buf.get_u32_le();
13884 __struct.eph = buf.get_u16_le();
13885 __struct.epv = buf.get_u16_le();
13886 __struct.vel = buf.get_u16_le();
13887 __struct.cog = buf.get_u16_le();
13888 let tmp = buf.get_u8();
13889 __struct.fix_type =
13890 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13891 enum_type: "GpsFixType",
13892 value: tmp as u32,
13893 })?;
13894 __struct.satellites_visible = buf.get_u8();
13895 __struct.dgps_numch = buf.get_u8();
13896 __struct.yaw = buf.get_u16_le();
13897 __struct.alt_ellipsoid = buf.get_i32_le();
13898 __struct.h_acc = buf.get_u32_le();
13899 __struct.v_acc = buf.get_u32_le();
13900 __struct.vel_acc = buf.get_u32_le();
13901 __struct.hdg_acc = buf.get_u32_le();
13902 Ok(__struct)
13903 }
13904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13905 let mut __tmp = BytesMut::new(bytes);
13906 #[allow(clippy::absurd_extreme_comparisons)]
13907 #[allow(unused_comparisons)]
13908 if __tmp.remaining() < Self::ENCODED_LEN {
13909 panic!(
13910 "buffer is too small (need {} bytes, but got {})",
13911 Self::ENCODED_LEN,
13912 __tmp.remaining(),
13913 )
13914 }
13915 __tmp.put_u64_le(self.time_usec);
13916 __tmp.put_i32_le(self.lat);
13917 __tmp.put_i32_le(self.lon);
13918 __tmp.put_i32_le(self.alt);
13919 __tmp.put_u32_le(self.dgps_age);
13920 __tmp.put_u16_le(self.eph);
13921 __tmp.put_u16_le(self.epv);
13922 __tmp.put_u16_le(self.vel);
13923 __tmp.put_u16_le(self.cog);
13924 __tmp.put_u8(self.fix_type as u8);
13925 __tmp.put_u8(self.satellites_visible);
13926 __tmp.put_u8(self.dgps_numch);
13927 if matches!(version, MavlinkVersion::V2) {
13928 __tmp.put_u16_le(self.yaw);
13929 __tmp.put_i32_le(self.alt_ellipsoid);
13930 __tmp.put_u32_le(self.h_acc);
13931 __tmp.put_u32_le(self.v_acc);
13932 __tmp.put_u32_le(self.vel_acc);
13933 __tmp.put_u32_le(self.hdg_acc);
13934 let len = __tmp.len();
13935 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13936 } else {
13937 __tmp.len()
13938 }
13939 }
13940}
13941#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13942#[doc = ""]
13943#[doc = "ID: 128"]
13944#[derive(Debug, Clone, PartialEq)]
13945#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13947#[cfg_attr(feature = "ts", derive(TS))]
13948#[cfg_attr(feature = "ts", ts(export))]
13949pub struct GPS2_RTK_DATA {
13950 #[doc = "Time since boot of last baseline message received."]
13951 pub time_last_baseline_ms: u32,
13952 #[doc = "GPS Time of Week of last baseline"]
13953 pub tow: u32,
13954 #[doc = "Current baseline in ECEF x or NED north component."]
13955 pub baseline_a_mm: i32,
13956 #[doc = "Current baseline in ECEF y or NED east component."]
13957 pub baseline_b_mm: i32,
13958 #[doc = "Current baseline in ECEF z or NED down component."]
13959 pub baseline_c_mm: i32,
13960 #[doc = "Current estimate of baseline accuracy."]
13961 pub accuracy: u32,
13962 #[doc = "Current number of integer ambiguity hypotheses."]
13963 pub iar_num_hypotheses: i32,
13964 #[doc = "GPS Week Number of last baseline"]
13965 pub wn: u16,
13966 #[doc = "Identification of connected RTK receiver."]
13967 pub rtk_receiver_id: u8,
13968 #[doc = "GPS-specific health report for RTK data."]
13969 pub rtk_health: u8,
13970 #[doc = "Rate of baseline messages being received by GPS"]
13971 pub rtk_rate: u8,
13972 #[doc = "Current number of sats used for RTK calculation."]
13973 pub nsats: u8,
13974 #[doc = "Coordinate system of baseline"]
13975 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13976}
13977impl GPS2_RTK_DATA {
13978 pub const ENCODED_LEN: usize = 35usize;
13979 pub const DEFAULT: Self = Self {
13980 time_last_baseline_ms: 0_u32,
13981 tow: 0_u32,
13982 baseline_a_mm: 0_i32,
13983 baseline_b_mm: 0_i32,
13984 baseline_c_mm: 0_i32,
13985 accuracy: 0_u32,
13986 iar_num_hypotheses: 0_i32,
13987 wn: 0_u16,
13988 rtk_receiver_id: 0_u8,
13989 rtk_health: 0_u8,
13990 rtk_rate: 0_u8,
13991 nsats: 0_u8,
13992 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13993 };
13994 #[cfg(feature = "arbitrary")]
13995 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13996 use arbitrary::{Arbitrary, Unstructured};
13997 let mut buf = [0u8; 1024];
13998 rng.fill_bytes(&mut buf);
13999 let mut unstructured = Unstructured::new(&buf);
14000 Self::arbitrary(&mut unstructured).unwrap_or_default()
14001 }
14002}
14003impl Default for GPS2_RTK_DATA {
14004 fn default() -> Self {
14005 Self::DEFAULT.clone()
14006 }
14007}
14008impl MessageData for GPS2_RTK_DATA {
14009 type Message = MavMessage;
14010 const ID: u32 = 128u32;
14011 const NAME: &'static str = "GPS2_RTK";
14012 const EXTRA_CRC: u8 = 226u8;
14013 const ENCODED_LEN: usize = 35usize;
14014 fn deser(
14015 _version: MavlinkVersion,
14016 __input: &[u8],
14017 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14018 let avail_len = __input.len();
14019 let mut payload_buf = [0; Self::ENCODED_LEN];
14020 let mut buf = if avail_len < Self::ENCODED_LEN {
14021 payload_buf[0..avail_len].copy_from_slice(__input);
14022 Bytes::new(&payload_buf)
14023 } else {
14024 Bytes::new(__input)
14025 };
14026 let mut __struct = Self::default();
14027 __struct.time_last_baseline_ms = buf.get_u32_le();
14028 __struct.tow = buf.get_u32_le();
14029 __struct.baseline_a_mm = buf.get_i32_le();
14030 __struct.baseline_b_mm = buf.get_i32_le();
14031 __struct.baseline_c_mm = buf.get_i32_le();
14032 __struct.accuracy = buf.get_u32_le();
14033 __struct.iar_num_hypotheses = buf.get_i32_le();
14034 __struct.wn = buf.get_u16_le();
14035 __struct.rtk_receiver_id = buf.get_u8();
14036 __struct.rtk_health = buf.get_u8();
14037 __struct.rtk_rate = buf.get_u8();
14038 __struct.nsats = buf.get_u8();
14039 let tmp = buf.get_u8();
14040 __struct.baseline_coords_type =
14041 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14042 enum_type: "RtkBaselineCoordinateSystem",
14043 value: tmp as u32,
14044 })?;
14045 Ok(__struct)
14046 }
14047 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14048 let mut __tmp = BytesMut::new(bytes);
14049 #[allow(clippy::absurd_extreme_comparisons)]
14050 #[allow(unused_comparisons)]
14051 if __tmp.remaining() < Self::ENCODED_LEN {
14052 panic!(
14053 "buffer is too small (need {} bytes, but got {})",
14054 Self::ENCODED_LEN,
14055 __tmp.remaining(),
14056 )
14057 }
14058 __tmp.put_u32_le(self.time_last_baseline_ms);
14059 __tmp.put_u32_le(self.tow);
14060 __tmp.put_i32_le(self.baseline_a_mm);
14061 __tmp.put_i32_le(self.baseline_b_mm);
14062 __tmp.put_i32_le(self.baseline_c_mm);
14063 __tmp.put_u32_le(self.accuracy);
14064 __tmp.put_i32_le(self.iar_num_hypotheses);
14065 __tmp.put_u16_le(self.wn);
14066 __tmp.put_u8(self.rtk_receiver_id);
14067 __tmp.put_u8(self.rtk_health);
14068 __tmp.put_u8(self.rtk_rate);
14069 __tmp.put_u8(self.nsats);
14070 __tmp.put_u8(self.baseline_coords_type as u8);
14071 if matches!(version, MavlinkVersion::V2) {
14072 let len = __tmp.len();
14073 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14074 } else {
14075 __tmp.len()
14076 }
14077 }
14078}
14079#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14080#[doc = ""]
14081#[doc = "ID: 49"]
14082#[derive(Debug, Clone, PartialEq)]
14083#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14084#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14085#[cfg_attr(feature = "ts", derive(TS))]
14086#[cfg_attr(feature = "ts", ts(export))]
14087pub struct GPS_GLOBAL_ORIGIN_DATA {
14088 #[doc = "Latitude (WGS84)"]
14089 pub latitude: i32,
14090 #[doc = "Longitude (WGS84)"]
14091 pub longitude: i32,
14092 #[doc = "Altitude (MSL). Positive for up."]
14093 pub altitude: i32,
14094 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14095 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14096 pub time_usec: u64,
14097}
14098impl GPS_GLOBAL_ORIGIN_DATA {
14099 pub const ENCODED_LEN: usize = 20usize;
14100 pub const DEFAULT: Self = Self {
14101 latitude: 0_i32,
14102 longitude: 0_i32,
14103 altitude: 0_i32,
14104 time_usec: 0_u64,
14105 };
14106 #[cfg(feature = "arbitrary")]
14107 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14108 use arbitrary::{Arbitrary, Unstructured};
14109 let mut buf = [0u8; 1024];
14110 rng.fill_bytes(&mut buf);
14111 let mut unstructured = Unstructured::new(&buf);
14112 Self::arbitrary(&mut unstructured).unwrap_or_default()
14113 }
14114}
14115impl Default for GPS_GLOBAL_ORIGIN_DATA {
14116 fn default() -> Self {
14117 Self::DEFAULT.clone()
14118 }
14119}
14120impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14121 type Message = MavMessage;
14122 const ID: u32 = 49u32;
14123 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14124 const EXTRA_CRC: u8 = 39u8;
14125 const ENCODED_LEN: usize = 20usize;
14126 fn deser(
14127 _version: MavlinkVersion,
14128 __input: &[u8],
14129 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14130 let avail_len = __input.len();
14131 let mut payload_buf = [0; Self::ENCODED_LEN];
14132 let mut buf = if avail_len < Self::ENCODED_LEN {
14133 payload_buf[0..avail_len].copy_from_slice(__input);
14134 Bytes::new(&payload_buf)
14135 } else {
14136 Bytes::new(__input)
14137 };
14138 let mut __struct = Self::default();
14139 __struct.latitude = buf.get_i32_le();
14140 __struct.longitude = buf.get_i32_le();
14141 __struct.altitude = buf.get_i32_le();
14142 __struct.time_usec = buf.get_u64_le();
14143 Ok(__struct)
14144 }
14145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14146 let mut __tmp = BytesMut::new(bytes);
14147 #[allow(clippy::absurd_extreme_comparisons)]
14148 #[allow(unused_comparisons)]
14149 if __tmp.remaining() < Self::ENCODED_LEN {
14150 panic!(
14151 "buffer is too small (need {} bytes, but got {})",
14152 Self::ENCODED_LEN,
14153 __tmp.remaining(),
14154 )
14155 }
14156 __tmp.put_i32_le(self.latitude);
14157 __tmp.put_i32_le(self.longitude);
14158 __tmp.put_i32_le(self.altitude);
14159 if matches!(version, MavlinkVersion::V2) {
14160 __tmp.put_u64_le(self.time_usec);
14161 let len = __tmp.len();
14162 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14163 } else {
14164 __tmp.len()
14165 }
14166 }
14167}
14168#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14169#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14170#[doc = ""]
14171#[doc = "ID: 123"]
14172#[derive(Debug, Clone, PartialEq)]
14173#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14174#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14175#[cfg_attr(feature = "ts", derive(TS))]
14176#[cfg_attr(feature = "ts", ts(export))]
14177pub struct GPS_INJECT_DATA_DATA {
14178 #[doc = "System ID"]
14179 pub target_system: u8,
14180 #[doc = "Component ID"]
14181 pub target_component: u8,
14182 #[doc = "Data length"]
14183 pub len: u8,
14184 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14185 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14186 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14187 pub data: [u8; 110],
14188}
14189impl GPS_INJECT_DATA_DATA {
14190 pub const ENCODED_LEN: usize = 113usize;
14191 pub const DEFAULT: Self = Self {
14192 target_system: 0_u8,
14193 target_component: 0_u8,
14194 len: 0_u8,
14195 data: [0_u8; 110usize],
14196 };
14197 #[cfg(feature = "arbitrary")]
14198 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14199 use arbitrary::{Arbitrary, Unstructured};
14200 let mut buf = [0u8; 1024];
14201 rng.fill_bytes(&mut buf);
14202 let mut unstructured = Unstructured::new(&buf);
14203 Self::arbitrary(&mut unstructured).unwrap_or_default()
14204 }
14205}
14206impl Default for GPS_INJECT_DATA_DATA {
14207 fn default() -> Self {
14208 Self::DEFAULT.clone()
14209 }
14210}
14211impl MessageData for GPS_INJECT_DATA_DATA {
14212 type Message = MavMessage;
14213 const ID: u32 = 123u32;
14214 const NAME: &'static str = "GPS_INJECT_DATA";
14215 const EXTRA_CRC: u8 = 250u8;
14216 const ENCODED_LEN: usize = 113usize;
14217 fn deser(
14218 _version: MavlinkVersion,
14219 __input: &[u8],
14220 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14221 let avail_len = __input.len();
14222 let mut payload_buf = [0; Self::ENCODED_LEN];
14223 let mut buf = if avail_len < Self::ENCODED_LEN {
14224 payload_buf[0..avail_len].copy_from_slice(__input);
14225 Bytes::new(&payload_buf)
14226 } else {
14227 Bytes::new(__input)
14228 };
14229 let mut __struct = Self::default();
14230 __struct.target_system = buf.get_u8();
14231 __struct.target_component = buf.get_u8();
14232 __struct.len = buf.get_u8();
14233 for v in &mut __struct.data {
14234 let val = buf.get_u8();
14235 *v = val;
14236 }
14237 Ok(__struct)
14238 }
14239 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14240 let mut __tmp = BytesMut::new(bytes);
14241 #[allow(clippy::absurd_extreme_comparisons)]
14242 #[allow(unused_comparisons)]
14243 if __tmp.remaining() < Self::ENCODED_LEN {
14244 panic!(
14245 "buffer is too small (need {} bytes, but got {})",
14246 Self::ENCODED_LEN,
14247 __tmp.remaining(),
14248 )
14249 }
14250 __tmp.put_u8(self.target_system);
14251 __tmp.put_u8(self.target_component);
14252 __tmp.put_u8(self.len);
14253 for val in &self.data {
14254 __tmp.put_u8(*val);
14255 }
14256 if matches!(version, MavlinkVersion::V2) {
14257 let len = __tmp.len();
14258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14259 } else {
14260 __tmp.len()
14261 }
14262 }
14263}
14264#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14265#[doc = ""]
14266#[doc = "ID: 232"]
14267#[derive(Debug, Clone, PartialEq)]
14268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14270#[cfg_attr(feature = "ts", derive(TS))]
14271#[cfg_attr(feature = "ts", ts(export))]
14272pub struct GPS_INPUT_DATA {
14273 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14274 pub time_usec: u64,
14275 #[doc = "GPS time (from start of GPS week)"]
14276 pub time_week_ms: u32,
14277 #[doc = "Latitude (WGS84)"]
14278 pub lat: i32,
14279 #[doc = "Longitude (WGS84)"]
14280 pub lon: i32,
14281 #[doc = "Altitude (MSL). Positive for up."]
14282 pub alt: f32,
14283 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14284 pub hdop: f32,
14285 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14286 pub vdop: f32,
14287 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14288 pub vn: f32,
14289 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14290 pub ve: f32,
14291 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14292 pub vd: f32,
14293 #[doc = "GPS speed accuracy"]
14294 pub speed_accuracy: f32,
14295 #[doc = "GPS horizontal accuracy"]
14296 pub horiz_accuracy: f32,
14297 #[doc = "GPS vertical accuracy"]
14298 pub vert_accuracy: f32,
14299 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14300 pub ignore_flags: GpsInputIgnoreFlags,
14301 #[doc = "GPS week number"]
14302 pub time_week: u16,
14303 #[doc = "ID of the GPS for multiple GPS inputs"]
14304 pub gps_id: u8,
14305 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14306 pub fix_type: u8,
14307 #[doc = "Number of satellites visible."]
14308 pub satellites_visible: u8,
14309 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14310 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14311 pub yaw: u16,
14312}
14313impl GPS_INPUT_DATA {
14314 pub const ENCODED_LEN: usize = 65usize;
14315 pub const DEFAULT: Self = Self {
14316 time_usec: 0_u64,
14317 time_week_ms: 0_u32,
14318 lat: 0_i32,
14319 lon: 0_i32,
14320 alt: 0.0_f32,
14321 hdop: 0.0_f32,
14322 vdop: 0.0_f32,
14323 vn: 0.0_f32,
14324 ve: 0.0_f32,
14325 vd: 0.0_f32,
14326 speed_accuracy: 0.0_f32,
14327 horiz_accuracy: 0.0_f32,
14328 vert_accuracy: 0.0_f32,
14329 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14330 time_week: 0_u16,
14331 gps_id: 0_u8,
14332 fix_type: 0_u8,
14333 satellites_visible: 0_u8,
14334 yaw: 0_u16,
14335 };
14336 #[cfg(feature = "arbitrary")]
14337 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14338 use arbitrary::{Arbitrary, Unstructured};
14339 let mut buf = [0u8; 1024];
14340 rng.fill_bytes(&mut buf);
14341 let mut unstructured = Unstructured::new(&buf);
14342 Self::arbitrary(&mut unstructured).unwrap_or_default()
14343 }
14344}
14345impl Default for GPS_INPUT_DATA {
14346 fn default() -> Self {
14347 Self::DEFAULT.clone()
14348 }
14349}
14350impl MessageData for GPS_INPUT_DATA {
14351 type Message = MavMessage;
14352 const ID: u32 = 232u32;
14353 const NAME: &'static str = "GPS_INPUT";
14354 const EXTRA_CRC: u8 = 151u8;
14355 const ENCODED_LEN: usize = 65usize;
14356 fn deser(
14357 _version: MavlinkVersion,
14358 __input: &[u8],
14359 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14360 let avail_len = __input.len();
14361 let mut payload_buf = [0; Self::ENCODED_LEN];
14362 let mut buf = if avail_len < Self::ENCODED_LEN {
14363 payload_buf[0..avail_len].copy_from_slice(__input);
14364 Bytes::new(&payload_buf)
14365 } else {
14366 Bytes::new(__input)
14367 };
14368 let mut __struct = Self::default();
14369 __struct.time_usec = buf.get_u64_le();
14370 __struct.time_week_ms = buf.get_u32_le();
14371 __struct.lat = buf.get_i32_le();
14372 __struct.lon = buf.get_i32_le();
14373 __struct.alt = buf.get_f32_le();
14374 __struct.hdop = buf.get_f32_le();
14375 __struct.vdop = buf.get_f32_le();
14376 __struct.vn = buf.get_f32_le();
14377 __struct.ve = buf.get_f32_le();
14378 __struct.vd = buf.get_f32_le();
14379 __struct.speed_accuracy = buf.get_f32_le();
14380 __struct.horiz_accuracy = buf.get_f32_le();
14381 __struct.vert_accuracy = buf.get_f32_le();
14382 let tmp = buf.get_u16_le();
14383 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14384 tmp & GpsInputIgnoreFlags::all().bits(),
14385 )
14386 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14387 flag_type: "GpsInputIgnoreFlags",
14388 value: tmp as u32,
14389 })?;
14390 __struct.time_week = buf.get_u16_le();
14391 __struct.gps_id = buf.get_u8();
14392 __struct.fix_type = buf.get_u8();
14393 __struct.satellites_visible = buf.get_u8();
14394 __struct.yaw = buf.get_u16_le();
14395 Ok(__struct)
14396 }
14397 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14398 let mut __tmp = BytesMut::new(bytes);
14399 #[allow(clippy::absurd_extreme_comparisons)]
14400 #[allow(unused_comparisons)]
14401 if __tmp.remaining() < Self::ENCODED_LEN {
14402 panic!(
14403 "buffer is too small (need {} bytes, but got {})",
14404 Self::ENCODED_LEN,
14405 __tmp.remaining(),
14406 )
14407 }
14408 __tmp.put_u64_le(self.time_usec);
14409 __tmp.put_u32_le(self.time_week_ms);
14410 __tmp.put_i32_le(self.lat);
14411 __tmp.put_i32_le(self.lon);
14412 __tmp.put_f32_le(self.alt);
14413 __tmp.put_f32_le(self.hdop);
14414 __tmp.put_f32_le(self.vdop);
14415 __tmp.put_f32_le(self.vn);
14416 __tmp.put_f32_le(self.ve);
14417 __tmp.put_f32_le(self.vd);
14418 __tmp.put_f32_le(self.speed_accuracy);
14419 __tmp.put_f32_le(self.horiz_accuracy);
14420 __tmp.put_f32_le(self.vert_accuracy);
14421 __tmp.put_u16_le(self.ignore_flags.bits());
14422 __tmp.put_u16_le(self.time_week);
14423 __tmp.put_u8(self.gps_id);
14424 __tmp.put_u8(self.fix_type);
14425 __tmp.put_u8(self.satellites_visible);
14426 if matches!(version, MavlinkVersion::V2) {
14427 __tmp.put_u16_le(self.yaw);
14428 let len = __tmp.len();
14429 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14430 } else {
14431 __tmp.len()
14432 }
14433 }
14434}
14435#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14436#[doc = ""]
14437#[doc = "ID: 24"]
14438#[derive(Debug, Clone, PartialEq)]
14439#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14440#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14441#[cfg_attr(feature = "ts", derive(TS))]
14442#[cfg_attr(feature = "ts", ts(export))]
14443pub struct GPS_RAW_INT_DATA {
14444 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14445 pub time_usec: u64,
14446 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14447 pub lat: i32,
14448 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14449 pub lon: i32,
14450 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14451 pub alt: i32,
14452 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14453 pub eph: u16,
14454 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14455 pub epv: u16,
14456 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14457 pub vel: u16,
14458 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14459 pub cog: u16,
14460 #[doc = "GPS fix type."]
14461 pub fix_type: GpsFixType,
14462 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14463 pub satellites_visible: u8,
14464 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14465 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14466 pub alt_ellipsoid: i32,
14467 #[doc = "Position uncertainty."]
14468 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14469 pub h_acc: u32,
14470 #[doc = "Altitude uncertainty."]
14471 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14472 pub v_acc: u32,
14473 #[doc = "Speed uncertainty."]
14474 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14475 pub vel_acc: u32,
14476 #[doc = "Heading / track uncertainty"]
14477 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14478 pub hdg_acc: u32,
14479 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14480 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14481 pub yaw: u16,
14482}
14483impl GPS_RAW_INT_DATA {
14484 pub const ENCODED_LEN: usize = 52usize;
14485 pub const DEFAULT: Self = Self {
14486 time_usec: 0_u64,
14487 lat: 0_i32,
14488 lon: 0_i32,
14489 alt: 0_i32,
14490 eph: 0_u16,
14491 epv: 0_u16,
14492 vel: 0_u16,
14493 cog: 0_u16,
14494 fix_type: GpsFixType::DEFAULT,
14495 satellites_visible: 0_u8,
14496 alt_ellipsoid: 0_i32,
14497 h_acc: 0_u32,
14498 v_acc: 0_u32,
14499 vel_acc: 0_u32,
14500 hdg_acc: 0_u32,
14501 yaw: 0_u16,
14502 };
14503 #[cfg(feature = "arbitrary")]
14504 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14505 use arbitrary::{Arbitrary, Unstructured};
14506 let mut buf = [0u8; 1024];
14507 rng.fill_bytes(&mut buf);
14508 let mut unstructured = Unstructured::new(&buf);
14509 Self::arbitrary(&mut unstructured).unwrap_or_default()
14510 }
14511}
14512impl Default for GPS_RAW_INT_DATA {
14513 fn default() -> Self {
14514 Self::DEFAULT.clone()
14515 }
14516}
14517impl MessageData for GPS_RAW_INT_DATA {
14518 type Message = MavMessage;
14519 const ID: u32 = 24u32;
14520 const NAME: &'static str = "GPS_RAW_INT";
14521 const EXTRA_CRC: u8 = 24u8;
14522 const ENCODED_LEN: usize = 52usize;
14523 fn deser(
14524 _version: MavlinkVersion,
14525 __input: &[u8],
14526 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14527 let avail_len = __input.len();
14528 let mut payload_buf = [0; Self::ENCODED_LEN];
14529 let mut buf = if avail_len < Self::ENCODED_LEN {
14530 payload_buf[0..avail_len].copy_from_slice(__input);
14531 Bytes::new(&payload_buf)
14532 } else {
14533 Bytes::new(__input)
14534 };
14535 let mut __struct = Self::default();
14536 __struct.time_usec = buf.get_u64_le();
14537 __struct.lat = buf.get_i32_le();
14538 __struct.lon = buf.get_i32_le();
14539 __struct.alt = buf.get_i32_le();
14540 __struct.eph = buf.get_u16_le();
14541 __struct.epv = buf.get_u16_le();
14542 __struct.vel = buf.get_u16_le();
14543 __struct.cog = buf.get_u16_le();
14544 let tmp = buf.get_u8();
14545 __struct.fix_type =
14546 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14547 enum_type: "GpsFixType",
14548 value: tmp as u32,
14549 })?;
14550 __struct.satellites_visible = buf.get_u8();
14551 __struct.alt_ellipsoid = buf.get_i32_le();
14552 __struct.h_acc = buf.get_u32_le();
14553 __struct.v_acc = buf.get_u32_le();
14554 __struct.vel_acc = buf.get_u32_le();
14555 __struct.hdg_acc = buf.get_u32_le();
14556 __struct.yaw = buf.get_u16_le();
14557 Ok(__struct)
14558 }
14559 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14560 let mut __tmp = BytesMut::new(bytes);
14561 #[allow(clippy::absurd_extreme_comparisons)]
14562 #[allow(unused_comparisons)]
14563 if __tmp.remaining() < Self::ENCODED_LEN {
14564 panic!(
14565 "buffer is too small (need {} bytes, but got {})",
14566 Self::ENCODED_LEN,
14567 __tmp.remaining(),
14568 )
14569 }
14570 __tmp.put_u64_le(self.time_usec);
14571 __tmp.put_i32_le(self.lat);
14572 __tmp.put_i32_le(self.lon);
14573 __tmp.put_i32_le(self.alt);
14574 __tmp.put_u16_le(self.eph);
14575 __tmp.put_u16_le(self.epv);
14576 __tmp.put_u16_le(self.vel);
14577 __tmp.put_u16_le(self.cog);
14578 __tmp.put_u8(self.fix_type as u8);
14579 __tmp.put_u8(self.satellites_visible);
14580 if matches!(version, MavlinkVersion::V2) {
14581 __tmp.put_i32_le(self.alt_ellipsoid);
14582 __tmp.put_u32_le(self.h_acc);
14583 __tmp.put_u32_le(self.v_acc);
14584 __tmp.put_u32_le(self.vel_acc);
14585 __tmp.put_u32_le(self.hdg_acc);
14586 __tmp.put_u16_le(self.yaw);
14587 let len = __tmp.len();
14588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14589 } else {
14590 __tmp.len()
14591 }
14592 }
14593}
14594#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14595#[doc = ""]
14596#[doc = "ID: 233"]
14597#[derive(Debug, Clone, PartialEq)]
14598#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14600#[cfg_attr(feature = "ts", derive(TS))]
14601#[cfg_attr(feature = "ts", ts(export))]
14602pub struct GPS_RTCM_DATA_DATA {
14603 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14604 pub flags: u8,
14605 #[doc = "data length"]
14606 pub len: u8,
14607 #[doc = "RTCM message (may be fragmented)"]
14608 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14609 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14610 pub data: [u8; 180],
14611}
14612impl GPS_RTCM_DATA_DATA {
14613 pub const ENCODED_LEN: usize = 182usize;
14614 pub const DEFAULT: Self = Self {
14615 flags: 0_u8,
14616 len: 0_u8,
14617 data: [0_u8; 180usize],
14618 };
14619 #[cfg(feature = "arbitrary")]
14620 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14621 use arbitrary::{Arbitrary, Unstructured};
14622 let mut buf = [0u8; 1024];
14623 rng.fill_bytes(&mut buf);
14624 let mut unstructured = Unstructured::new(&buf);
14625 Self::arbitrary(&mut unstructured).unwrap_or_default()
14626 }
14627}
14628impl Default for GPS_RTCM_DATA_DATA {
14629 fn default() -> Self {
14630 Self::DEFAULT.clone()
14631 }
14632}
14633impl MessageData for GPS_RTCM_DATA_DATA {
14634 type Message = MavMessage;
14635 const ID: u32 = 233u32;
14636 const NAME: &'static str = "GPS_RTCM_DATA";
14637 const EXTRA_CRC: u8 = 35u8;
14638 const ENCODED_LEN: usize = 182usize;
14639 fn deser(
14640 _version: MavlinkVersion,
14641 __input: &[u8],
14642 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14643 let avail_len = __input.len();
14644 let mut payload_buf = [0; Self::ENCODED_LEN];
14645 let mut buf = if avail_len < Self::ENCODED_LEN {
14646 payload_buf[0..avail_len].copy_from_slice(__input);
14647 Bytes::new(&payload_buf)
14648 } else {
14649 Bytes::new(__input)
14650 };
14651 let mut __struct = Self::default();
14652 __struct.flags = buf.get_u8();
14653 __struct.len = buf.get_u8();
14654 for v in &mut __struct.data {
14655 let val = buf.get_u8();
14656 *v = val;
14657 }
14658 Ok(__struct)
14659 }
14660 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14661 let mut __tmp = BytesMut::new(bytes);
14662 #[allow(clippy::absurd_extreme_comparisons)]
14663 #[allow(unused_comparisons)]
14664 if __tmp.remaining() < Self::ENCODED_LEN {
14665 panic!(
14666 "buffer is too small (need {} bytes, but got {})",
14667 Self::ENCODED_LEN,
14668 __tmp.remaining(),
14669 )
14670 }
14671 __tmp.put_u8(self.flags);
14672 __tmp.put_u8(self.len);
14673 for val in &self.data {
14674 __tmp.put_u8(*val);
14675 }
14676 if matches!(version, MavlinkVersion::V2) {
14677 let len = __tmp.len();
14678 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14679 } else {
14680 __tmp.len()
14681 }
14682 }
14683}
14684#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14685#[doc = ""]
14686#[doc = "ID: 127"]
14687#[derive(Debug, Clone, PartialEq)]
14688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14690#[cfg_attr(feature = "ts", derive(TS))]
14691#[cfg_attr(feature = "ts", ts(export))]
14692pub struct GPS_RTK_DATA {
14693 #[doc = "Time since boot of last baseline message received."]
14694 pub time_last_baseline_ms: u32,
14695 #[doc = "GPS Time of Week of last baseline"]
14696 pub tow: u32,
14697 #[doc = "Current baseline in ECEF x or NED north component."]
14698 pub baseline_a_mm: i32,
14699 #[doc = "Current baseline in ECEF y or NED east component."]
14700 pub baseline_b_mm: i32,
14701 #[doc = "Current baseline in ECEF z or NED down component."]
14702 pub baseline_c_mm: i32,
14703 #[doc = "Current estimate of baseline accuracy."]
14704 pub accuracy: u32,
14705 #[doc = "Current number of integer ambiguity hypotheses."]
14706 pub iar_num_hypotheses: i32,
14707 #[doc = "GPS Week Number of last baseline"]
14708 pub wn: u16,
14709 #[doc = "Identification of connected RTK receiver."]
14710 pub rtk_receiver_id: u8,
14711 #[doc = "GPS-specific health report for RTK data."]
14712 pub rtk_health: u8,
14713 #[doc = "Rate of baseline messages being received by GPS"]
14714 pub rtk_rate: u8,
14715 #[doc = "Current number of sats used for RTK calculation."]
14716 pub nsats: u8,
14717 #[doc = "Coordinate system of baseline"]
14718 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14719}
14720impl GPS_RTK_DATA {
14721 pub const ENCODED_LEN: usize = 35usize;
14722 pub const DEFAULT: Self = Self {
14723 time_last_baseline_ms: 0_u32,
14724 tow: 0_u32,
14725 baseline_a_mm: 0_i32,
14726 baseline_b_mm: 0_i32,
14727 baseline_c_mm: 0_i32,
14728 accuracy: 0_u32,
14729 iar_num_hypotheses: 0_i32,
14730 wn: 0_u16,
14731 rtk_receiver_id: 0_u8,
14732 rtk_health: 0_u8,
14733 rtk_rate: 0_u8,
14734 nsats: 0_u8,
14735 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14736 };
14737 #[cfg(feature = "arbitrary")]
14738 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14739 use arbitrary::{Arbitrary, Unstructured};
14740 let mut buf = [0u8; 1024];
14741 rng.fill_bytes(&mut buf);
14742 let mut unstructured = Unstructured::new(&buf);
14743 Self::arbitrary(&mut unstructured).unwrap_or_default()
14744 }
14745}
14746impl Default for GPS_RTK_DATA {
14747 fn default() -> Self {
14748 Self::DEFAULT.clone()
14749 }
14750}
14751impl MessageData for GPS_RTK_DATA {
14752 type Message = MavMessage;
14753 const ID: u32 = 127u32;
14754 const NAME: &'static str = "GPS_RTK";
14755 const EXTRA_CRC: u8 = 25u8;
14756 const ENCODED_LEN: usize = 35usize;
14757 fn deser(
14758 _version: MavlinkVersion,
14759 __input: &[u8],
14760 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14761 let avail_len = __input.len();
14762 let mut payload_buf = [0; Self::ENCODED_LEN];
14763 let mut buf = if avail_len < Self::ENCODED_LEN {
14764 payload_buf[0..avail_len].copy_from_slice(__input);
14765 Bytes::new(&payload_buf)
14766 } else {
14767 Bytes::new(__input)
14768 };
14769 let mut __struct = Self::default();
14770 __struct.time_last_baseline_ms = buf.get_u32_le();
14771 __struct.tow = buf.get_u32_le();
14772 __struct.baseline_a_mm = buf.get_i32_le();
14773 __struct.baseline_b_mm = buf.get_i32_le();
14774 __struct.baseline_c_mm = buf.get_i32_le();
14775 __struct.accuracy = buf.get_u32_le();
14776 __struct.iar_num_hypotheses = buf.get_i32_le();
14777 __struct.wn = buf.get_u16_le();
14778 __struct.rtk_receiver_id = buf.get_u8();
14779 __struct.rtk_health = buf.get_u8();
14780 __struct.rtk_rate = buf.get_u8();
14781 __struct.nsats = buf.get_u8();
14782 let tmp = buf.get_u8();
14783 __struct.baseline_coords_type =
14784 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14785 enum_type: "RtkBaselineCoordinateSystem",
14786 value: tmp as u32,
14787 })?;
14788 Ok(__struct)
14789 }
14790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14791 let mut __tmp = BytesMut::new(bytes);
14792 #[allow(clippy::absurd_extreme_comparisons)]
14793 #[allow(unused_comparisons)]
14794 if __tmp.remaining() < Self::ENCODED_LEN {
14795 panic!(
14796 "buffer is too small (need {} bytes, but got {})",
14797 Self::ENCODED_LEN,
14798 __tmp.remaining(),
14799 )
14800 }
14801 __tmp.put_u32_le(self.time_last_baseline_ms);
14802 __tmp.put_u32_le(self.tow);
14803 __tmp.put_i32_le(self.baseline_a_mm);
14804 __tmp.put_i32_le(self.baseline_b_mm);
14805 __tmp.put_i32_le(self.baseline_c_mm);
14806 __tmp.put_u32_le(self.accuracy);
14807 __tmp.put_i32_le(self.iar_num_hypotheses);
14808 __tmp.put_u16_le(self.wn);
14809 __tmp.put_u8(self.rtk_receiver_id);
14810 __tmp.put_u8(self.rtk_health);
14811 __tmp.put_u8(self.rtk_rate);
14812 __tmp.put_u8(self.nsats);
14813 __tmp.put_u8(self.baseline_coords_type as u8);
14814 if matches!(version, MavlinkVersion::V2) {
14815 let len = __tmp.len();
14816 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14817 } else {
14818 __tmp.len()
14819 }
14820 }
14821}
14822#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14823#[doc = ""]
14824#[doc = "ID: 25"]
14825#[derive(Debug, Clone, PartialEq)]
14826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14828#[cfg_attr(feature = "ts", derive(TS))]
14829#[cfg_attr(feature = "ts", ts(export))]
14830pub struct GPS_STATUS_DATA {
14831 #[doc = "Number of satellites visible"]
14832 pub satellites_visible: u8,
14833 #[doc = "Global satellite ID"]
14834 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14835 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14836 pub satellite_prn: [u8; 20],
14837 #[doc = "0: Satellite not used, 1: used for localization"]
14838 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14839 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14840 pub satellite_used: [u8; 20],
14841 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14842 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14843 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14844 pub satellite_elevation: [u8; 20],
14845 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14846 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14847 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14848 pub satellite_azimuth: [u8; 20],
14849 #[doc = "Signal to noise ratio of satellite"]
14850 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14851 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14852 pub satellite_snr: [u8; 20],
14853}
14854impl GPS_STATUS_DATA {
14855 pub const ENCODED_LEN: usize = 101usize;
14856 pub const DEFAULT: Self = Self {
14857 satellites_visible: 0_u8,
14858 satellite_prn: [0_u8; 20usize],
14859 satellite_used: [0_u8; 20usize],
14860 satellite_elevation: [0_u8; 20usize],
14861 satellite_azimuth: [0_u8; 20usize],
14862 satellite_snr: [0_u8; 20usize],
14863 };
14864 #[cfg(feature = "arbitrary")]
14865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14866 use arbitrary::{Arbitrary, Unstructured};
14867 let mut buf = [0u8; 1024];
14868 rng.fill_bytes(&mut buf);
14869 let mut unstructured = Unstructured::new(&buf);
14870 Self::arbitrary(&mut unstructured).unwrap_or_default()
14871 }
14872}
14873impl Default for GPS_STATUS_DATA {
14874 fn default() -> Self {
14875 Self::DEFAULT.clone()
14876 }
14877}
14878impl MessageData for GPS_STATUS_DATA {
14879 type Message = MavMessage;
14880 const ID: u32 = 25u32;
14881 const NAME: &'static str = "GPS_STATUS";
14882 const EXTRA_CRC: u8 = 23u8;
14883 const ENCODED_LEN: usize = 101usize;
14884 fn deser(
14885 _version: MavlinkVersion,
14886 __input: &[u8],
14887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14888 let avail_len = __input.len();
14889 let mut payload_buf = [0; Self::ENCODED_LEN];
14890 let mut buf = if avail_len < Self::ENCODED_LEN {
14891 payload_buf[0..avail_len].copy_from_slice(__input);
14892 Bytes::new(&payload_buf)
14893 } else {
14894 Bytes::new(__input)
14895 };
14896 let mut __struct = Self::default();
14897 __struct.satellites_visible = buf.get_u8();
14898 for v in &mut __struct.satellite_prn {
14899 let val = buf.get_u8();
14900 *v = val;
14901 }
14902 for v in &mut __struct.satellite_used {
14903 let val = buf.get_u8();
14904 *v = val;
14905 }
14906 for v in &mut __struct.satellite_elevation {
14907 let val = buf.get_u8();
14908 *v = val;
14909 }
14910 for v in &mut __struct.satellite_azimuth {
14911 let val = buf.get_u8();
14912 *v = val;
14913 }
14914 for v in &mut __struct.satellite_snr {
14915 let val = buf.get_u8();
14916 *v = val;
14917 }
14918 Ok(__struct)
14919 }
14920 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14921 let mut __tmp = BytesMut::new(bytes);
14922 #[allow(clippy::absurd_extreme_comparisons)]
14923 #[allow(unused_comparisons)]
14924 if __tmp.remaining() < Self::ENCODED_LEN {
14925 panic!(
14926 "buffer is too small (need {} bytes, but got {})",
14927 Self::ENCODED_LEN,
14928 __tmp.remaining(),
14929 )
14930 }
14931 __tmp.put_u8(self.satellites_visible);
14932 for val in &self.satellite_prn {
14933 __tmp.put_u8(*val);
14934 }
14935 for val in &self.satellite_used {
14936 __tmp.put_u8(*val);
14937 }
14938 for val in &self.satellite_elevation {
14939 __tmp.put_u8(*val);
14940 }
14941 for val in &self.satellite_azimuth {
14942 __tmp.put_u8(*val);
14943 }
14944 for val in &self.satellite_snr {
14945 __tmp.put_u8(*val);
14946 }
14947 if matches!(version, MavlinkVersion::V2) {
14948 let len = __tmp.len();
14949 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14950 } else {
14951 __tmp.len()
14952 }
14953 }
14954}
14955#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14956#[doc = ""]
14957#[doc = "ID: 0"]
14958#[derive(Debug, Clone, PartialEq)]
14959#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14960#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14961#[cfg_attr(feature = "ts", derive(TS))]
14962#[cfg_attr(feature = "ts", ts(export))]
14963pub struct HEARTBEAT_DATA {
14964 #[doc = "A bitfield for use for autopilot-specific flags"]
14965 pub custom_mode: u32,
14966 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14967 pub mavtype: MavType,
14968 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14969 pub autopilot: MavAutopilot,
14970 #[doc = "System mode bitmap."]
14971 pub base_mode: MavModeFlag,
14972 #[doc = "System status flag."]
14973 pub system_status: MavState,
14974 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14975 pub mavlink_version: u8,
14976}
14977impl HEARTBEAT_DATA {
14978 pub const ENCODED_LEN: usize = 9usize;
14979 pub const DEFAULT: Self = Self {
14980 custom_mode: 0_u32,
14981 mavtype: MavType::DEFAULT,
14982 autopilot: MavAutopilot::DEFAULT,
14983 base_mode: MavModeFlag::DEFAULT,
14984 system_status: MavState::DEFAULT,
14985 mavlink_version: MINOR_MAVLINK_VERSION,
14986 };
14987 #[cfg(feature = "arbitrary")]
14988 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14989 use arbitrary::{Arbitrary, Unstructured};
14990 let mut buf = [0u8; 1024];
14991 rng.fill_bytes(&mut buf);
14992 let mut unstructured = Unstructured::new(&buf);
14993 Self::arbitrary(&mut unstructured).unwrap_or_default()
14994 }
14995}
14996impl Default for HEARTBEAT_DATA {
14997 fn default() -> Self {
14998 Self::DEFAULT.clone()
14999 }
15000}
15001impl MessageData for HEARTBEAT_DATA {
15002 type Message = MavMessage;
15003 const ID: u32 = 0u32;
15004 const NAME: &'static str = "HEARTBEAT";
15005 const EXTRA_CRC: u8 = 50u8;
15006 const ENCODED_LEN: usize = 9usize;
15007 fn deser(
15008 _version: MavlinkVersion,
15009 __input: &[u8],
15010 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15011 let avail_len = __input.len();
15012 let mut payload_buf = [0; Self::ENCODED_LEN];
15013 let mut buf = if avail_len < Self::ENCODED_LEN {
15014 payload_buf[0..avail_len].copy_from_slice(__input);
15015 Bytes::new(&payload_buf)
15016 } else {
15017 Bytes::new(__input)
15018 };
15019 let mut __struct = Self::default();
15020 __struct.custom_mode = buf.get_u32_le();
15021 let tmp = buf.get_u8();
15022 __struct.mavtype =
15023 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15024 enum_type: "MavType",
15025 value: tmp as u32,
15026 })?;
15027 let tmp = buf.get_u8();
15028 __struct.autopilot =
15029 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15030 enum_type: "MavAutopilot",
15031 value: tmp as u32,
15032 })?;
15033 let tmp = buf.get_u8();
15034 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15035 ::mavlink_core::error::ParserError::InvalidFlag {
15036 flag_type: "MavModeFlag",
15037 value: tmp as u32,
15038 },
15039 )?;
15040 let tmp = buf.get_u8();
15041 __struct.system_status =
15042 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15043 enum_type: "MavState",
15044 value: tmp as u32,
15045 })?;
15046 __struct.mavlink_version = buf.get_u8();
15047 Ok(__struct)
15048 }
15049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15050 let mut __tmp = BytesMut::new(bytes);
15051 #[allow(clippy::absurd_extreme_comparisons)]
15052 #[allow(unused_comparisons)]
15053 if __tmp.remaining() < Self::ENCODED_LEN {
15054 panic!(
15055 "buffer is too small (need {} bytes, but got {})",
15056 Self::ENCODED_LEN,
15057 __tmp.remaining(),
15058 )
15059 }
15060 __tmp.put_u32_le(self.custom_mode);
15061 __tmp.put_u8(self.mavtype as u8);
15062 __tmp.put_u8(self.autopilot as u8);
15063 __tmp.put_u8(self.base_mode.bits());
15064 __tmp.put_u8(self.system_status as u8);
15065 __tmp.put_u8(self.mavlink_version);
15066 if matches!(version, MavlinkVersion::V2) {
15067 let len = __tmp.len();
15068 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15069 } else {
15070 __tmp.len()
15071 }
15072 }
15073}
15074#[doc = "The IMU readings in SI units in NED body frame."]
15075#[doc = ""]
15076#[doc = "ID: 105"]
15077#[derive(Debug, Clone, PartialEq)]
15078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15080#[cfg_attr(feature = "ts", derive(TS))]
15081#[cfg_attr(feature = "ts", ts(export))]
15082pub struct HIGHRES_IMU_DATA {
15083 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15084 pub time_usec: u64,
15085 #[doc = "X acceleration"]
15086 pub xacc: f32,
15087 #[doc = "Y acceleration"]
15088 pub yacc: f32,
15089 #[doc = "Z acceleration"]
15090 pub zacc: f32,
15091 #[doc = "Angular speed around X axis"]
15092 pub xgyro: f32,
15093 #[doc = "Angular speed around Y axis"]
15094 pub ygyro: f32,
15095 #[doc = "Angular speed around Z axis"]
15096 pub zgyro: f32,
15097 #[doc = "X Magnetic field"]
15098 pub xmag: f32,
15099 #[doc = "Y Magnetic field"]
15100 pub ymag: f32,
15101 #[doc = "Z Magnetic field"]
15102 pub zmag: f32,
15103 #[doc = "Absolute pressure"]
15104 pub abs_pressure: f32,
15105 #[doc = "Differential pressure"]
15106 pub diff_pressure: f32,
15107 #[doc = "Altitude calculated from pressure"]
15108 pub pressure_alt: f32,
15109 #[doc = "Temperature"]
15110 pub temperature: f32,
15111 #[doc = "Bitmap for fields that have updated since last message"]
15112 pub fields_updated: HighresImuUpdatedFlags,
15113 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15114 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15115 pub id: u8,
15116}
15117impl HIGHRES_IMU_DATA {
15118 pub const ENCODED_LEN: usize = 63usize;
15119 pub const DEFAULT: Self = Self {
15120 time_usec: 0_u64,
15121 xacc: 0.0_f32,
15122 yacc: 0.0_f32,
15123 zacc: 0.0_f32,
15124 xgyro: 0.0_f32,
15125 ygyro: 0.0_f32,
15126 zgyro: 0.0_f32,
15127 xmag: 0.0_f32,
15128 ymag: 0.0_f32,
15129 zmag: 0.0_f32,
15130 abs_pressure: 0.0_f32,
15131 diff_pressure: 0.0_f32,
15132 pressure_alt: 0.0_f32,
15133 temperature: 0.0_f32,
15134 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15135 id: 0_u8,
15136 };
15137 #[cfg(feature = "arbitrary")]
15138 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15139 use arbitrary::{Arbitrary, Unstructured};
15140 let mut buf = [0u8; 1024];
15141 rng.fill_bytes(&mut buf);
15142 let mut unstructured = Unstructured::new(&buf);
15143 Self::arbitrary(&mut unstructured).unwrap_or_default()
15144 }
15145}
15146impl Default for HIGHRES_IMU_DATA {
15147 fn default() -> Self {
15148 Self::DEFAULT.clone()
15149 }
15150}
15151impl MessageData for HIGHRES_IMU_DATA {
15152 type Message = MavMessage;
15153 const ID: u32 = 105u32;
15154 const NAME: &'static str = "HIGHRES_IMU";
15155 const EXTRA_CRC: u8 = 93u8;
15156 const ENCODED_LEN: usize = 63usize;
15157 fn deser(
15158 _version: MavlinkVersion,
15159 __input: &[u8],
15160 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15161 let avail_len = __input.len();
15162 let mut payload_buf = [0; Self::ENCODED_LEN];
15163 let mut buf = if avail_len < Self::ENCODED_LEN {
15164 payload_buf[0..avail_len].copy_from_slice(__input);
15165 Bytes::new(&payload_buf)
15166 } else {
15167 Bytes::new(__input)
15168 };
15169 let mut __struct = Self::default();
15170 __struct.time_usec = buf.get_u64_le();
15171 __struct.xacc = buf.get_f32_le();
15172 __struct.yacc = buf.get_f32_le();
15173 __struct.zacc = buf.get_f32_le();
15174 __struct.xgyro = buf.get_f32_le();
15175 __struct.ygyro = buf.get_f32_le();
15176 __struct.zgyro = buf.get_f32_le();
15177 __struct.xmag = buf.get_f32_le();
15178 __struct.ymag = buf.get_f32_le();
15179 __struct.zmag = buf.get_f32_le();
15180 __struct.abs_pressure = buf.get_f32_le();
15181 __struct.diff_pressure = buf.get_f32_le();
15182 __struct.pressure_alt = buf.get_f32_le();
15183 __struct.temperature = buf.get_f32_le();
15184 let tmp = buf.get_u16_le();
15185 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
15186 tmp & HighresImuUpdatedFlags::all().bits(),
15187 )
15188 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15189 flag_type: "HighresImuUpdatedFlags",
15190 value: tmp as u32,
15191 })?;
15192 __struct.id = buf.get_u8();
15193 Ok(__struct)
15194 }
15195 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15196 let mut __tmp = BytesMut::new(bytes);
15197 #[allow(clippy::absurd_extreme_comparisons)]
15198 #[allow(unused_comparisons)]
15199 if __tmp.remaining() < Self::ENCODED_LEN {
15200 panic!(
15201 "buffer is too small (need {} bytes, but got {})",
15202 Self::ENCODED_LEN,
15203 __tmp.remaining(),
15204 )
15205 }
15206 __tmp.put_u64_le(self.time_usec);
15207 __tmp.put_f32_le(self.xacc);
15208 __tmp.put_f32_le(self.yacc);
15209 __tmp.put_f32_le(self.zacc);
15210 __tmp.put_f32_le(self.xgyro);
15211 __tmp.put_f32_le(self.ygyro);
15212 __tmp.put_f32_le(self.zgyro);
15213 __tmp.put_f32_le(self.xmag);
15214 __tmp.put_f32_le(self.ymag);
15215 __tmp.put_f32_le(self.zmag);
15216 __tmp.put_f32_le(self.abs_pressure);
15217 __tmp.put_f32_le(self.diff_pressure);
15218 __tmp.put_f32_le(self.pressure_alt);
15219 __tmp.put_f32_le(self.temperature);
15220 __tmp.put_u16_le(self.fields_updated.bits());
15221 if matches!(version, MavlinkVersion::V2) {
15222 __tmp.put_u8(self.id);
15223 let len = __tmp.len();
15224 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15225 } else {
15226 __tmp.len()
15227 }
15228 }
15229}
15230#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15231#[doc = "Message appropriate for high latency connections like Iridium."]
15232#[doc = ""]
15233#[doc = "ID: 234"]
15234#[derive(Debug, Clone, PartialEq)]
15235#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15236#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15237#[cfg_attr(feature = "ts", derive(TS))]
15238#[cfg_attr(feature = "ts", ts(export))]
15239pub struct HIGH_LATENCY_DATA {
15240 #[doc = "A bitfield for use for autopilot-specific flags."]
15241 pub custom_mode: u32,
15242 #[doc = "Latitude"]
15243 pub latitude: i32,
15244 #[doc = "Longitude"]
15245 pub longitude: i32,
15246 #[doc = "roll"]
15247 pub roll: i16,
15248 #[doc = "pitch"]
15249 pub pitch: i16,
15250 #[doc = "heading"]
15251 pub heading: u16,
15252 #[doc = "heading setpoint"]
15253 pub heading_sp: i16,
15254 #[doc = "Altitude above mean sea level"]
15255 pub altitude_amsl: i16,
15256 #[doc = "Altitude setpoint relative to the home position"]
15257 pub altitude_sp: i16,
15258 #[doc = "distance to target"]
15259 pub wp_distance: u16,
15260 #[doc = "Bitmap of enabled system modes."]
15261 pub base_mode: MavModeFlag,
15262 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15263 pub landed_state: MavLandedState,
15264 #[doc = "throttle (percentage)"]
15265 pub throttle: i8,
15266 #[doc = "airspeed"]
15267 pub airspeed: u8,
15268 #[doc = "airspeed setpoint"]
15269 pub airspeed_sp: u8,
15270 #[doc = "groundspeed"]
15271 pub groundspeed: u8,
15272 #[doc = "climb rate"]
15273 pub climb_rate: i8,
15274 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15275 pub gps_nsat: u8,
15276 #[doc = "GPS Fix type."]
15277 pub gps_fix_type: GpsFixType,
15278 #[doc = "Remaining battery (percentage)"]
15279 pub battery_remaining: u8,
15280 #[doc = "Autopilot temperature (degrees C)"]
15281 pub temperature: i8,
15282 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15283 pub temperature_air: i8,
15284 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15285 pub failsafe: u8,
15286 #[doc = "current waypoint number"]
15287 pub wp_num: u8,
15288}
15289impl HIGH_LATENCY_DATA {
15290 pub const ENCODED_LEN: usize = 40usize;
15291 pub const DEFAULT: Self = Self {
15292 custom_mode: 0_u32,
15293 latitude: 0_i32,
15294 longitude: 0_i32,
15295 roll: 0_i16,
15296 pitch: 0_i16,
15297 heading: 0_u16,
15298 heading_sp: 0_i16,
15299 altitude_amsl: 0_i16,
15300 altitude_sp: 0_i16,
15301 wp_distance: 0_u16,
15302 base_mode: MavModeFlag::DEFAULT,
15303 landed_state: MavLandedState::DEFAULT,
15304 throttle: 0_i8,
15305 airspeed: 0_u8,
15306 airspeed_sp: 0_u8,
15307 groundspeed: 0_u8,
15308 climb_rate: 0_i8,
15309 gps_nsat: 0_u8,
15310 gps_fix_type: GpsFixType::DEFAULT,
15311 battery_remaining: 0_u8,
15312 temperature: 0_i8,
15313 temperature_air: 0_i8,
15314 failsafe: 0_u8,
15315 wp_num: 0_u8,
15316 };
15317 #[cfg(feature = "arbitrary")]
15318 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15319 use arbitrary::{Arbitrary, Unstructured};
15320 let mut buf = [0u8; 1024];
15321 rng.fill_bytes(&mut buf);
15322 let mut unstructured = Unstructured::new(&buf);
15323 Self::arbitrary(&mut unstructured).unwrap_or_default()
15324 }
15325}
15326impl Default for HIGH_LATENCY_DATA {
15327 fn default() -> Self {
15328 Self::DEFAULT.clone()
15329 }
15330}
15331impl MessageData for HIGH_LATENCY_DATA {
15332 type Message = MavMessage;
15333 const ID: u32 = 234u32;
15334 const NAME: &'static str = "HIGH_LATENCY";
15335 const EXTRA_CRC: u8 = 150u8;
15336 const ENCODED_LEN: usize = 40usize;
15337 fn deser(
15338 _version: MavlinkVersion,
15339 __input: &[u8],
15340 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15341 let avail_len = __input.len();
15342 let mut payload_buf = [0; Self::ENCODED_LEN];
15343 let mut buf = if avail_len < Self::ENCODED_LEN {
15344 payload_buf[0..avail_len].copy_from_slice(__input);
15345 Bytes::new(&payload_buf)
15346 } else {
15347 Bytes::new(__input)
15348 };
15349 let mut __struct = Self::default();
15350 __struct.custom_mode = buf.get_u32_le();
15351 __struct.latitude = buf.get_i32_le();
15352 __struct.longitude = buf.get_i32_le();
15353 __struct.roll = buf.get_i16_le();
15354 __struct.pitch = buf.get_i16_le();
15355 __struct.heading = buf.get_u16_le();
15356 __struct.heading_sp = buf.get_i16_le();
15357 __struct.altitude_amsl = buf.get_i16_le();
15358 __struct.altitude_sp = buf.get_i16_le();
15359 __struct.wp_distance = buf.get_u16_le();
15360 let tmp = buf.get_u8();
15361 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15362 ::mavlink_core::error::ParserError::InvalidFlag {
15363 flag_type: "MavModeFlag",
15364 value: tmp as u32,
15365 },
15366 )?;
15367 let tmp = buf.get_u8();
15368 __struct.landed_state =
15369 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15370 enum_type: "MavLandedState",
15371 value: tmp as u32,
15372 })?;
15373 __struct.throttle = buf.get_i8();
15374 __struct.airspeed = buf.get_u8();
15375 __struct.airspeed_sp = buf.get_u8();
15376 __struct.groundspeed = buf.get_u8();
15377 __struct.climb_rate = buf.get_i8();
15378 __struct.gps_nsat = buf.get_u8();
15379 let tmp = buf.get_u8();
15380 __struct.gps_fix_type =
15381 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15382 enum_type: "GpsFixType",
15383 value: tmp as u32,
15384 })?;
15385 __struct.battery_remaining = buf.get_u8();
15386 __struct.temperature = buf.get_i8();
15387 __struct.temperature_air = buf.get_i8();
15388 __struct.failsafe = buf.get_u8();
15389 __struct.wp_num = buf.get_u8();
15390 Ok(__struct)
15391 }
15392 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15393 let mut __tmp = BytesMut::new(bytes);
15394 #[allow(clippy::absurd_extreme_comparisons)]
15395 #[allow(unused_comparisons)]
15396 if __tmp.remaining() < Self::ENCODED_LEN {
15397 panic!(
15398 "buffer is too small (need {} bytes, but got {})",
15399 Self::ENCODED_LEN,
15400 __tmp.remaining(),
15401 )
15402 }
15403 __tmp.put_u32_le(self.custom_mode);
15404 __tmp.put_i32_le(self.latitude);
15405 __tmp.put_i32_le(self.longitude);
15406 __tmp.put_i16_le(self.roll);
15407 __tmp.put_i16_le(self.pitch);
15408 __tmp.put_u16_le(self.heading);
15409 __tmp.put_i16_le(self.heading_sp);
15410 __tmp.put_i16_le(self.altitude_amsl);
15411 __tmp.put_i16_le(self.altitude_sp);
15412 __tmp.put_u16_le(self.wp_distance);
15413 __tmp.put_u8(self.base_mode.bits());
15414 __tmp.put_u8(self.landed_state as u8);
15415 __tmp.put_i8(self.throttle);
15416 __tmp.put_u8(self.airspeed);
15417 __tmp.put_u8(self.airspeed_sp);
15418 __tmp.put_u8(self.groundspeed);
15419 __tmp.put_i8(self.climb_rate);
15420 __tmp.put_u8(self.gps_nsat);
15421 __tmp.put_u8(self.gps_fix_type as u8);
15422 __tmp.put_u8(self.battery_remaining);
15423 __tmp.put_i8(self.temperature);
15424 __tmp.put_i8(self.temperature_air);
15425 __tmp.put_u8(self.failsafe);
15426 __tmp.put_u8(self.wp_num);
15427 if matches!(version, MavlinkVersion::V2) {
15428 let len = __tmp.len();
15429 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15430 } else {
15431 __tmp.len()
15432 }
15433 }
15434}
15435#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15436#[doc = ""]
15437#[doc = "ID: 235"]
15438#[derive(Debug, Clone, PartialEq)]
15439#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15440#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15441#[cfg_attr(feature = "ts", derive(TS))]
15442#[cfg_attr(feature = "ts", ts(export))]
15443pub struct HIGH_LATENCY2_DATA {
15444 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15445 pub timestamp: u32,
15446 #[doc = "Latitude"]
15447 pub latitude: i32,
15448 #[doc = "Longitude"]
15449 pub longitude: i32,
15450 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15451 pub custom_mode: u16,
15452 #[doc = "Altitude above mean sea level"]
15453 pub altitude: i16,
15454 #[doc = "Altitude setpoint"]
15455 pub target_altitude: i16,
15456 #[doc = "Distance to target waypoint or position"]
15457 pub target_distance: u16,
15458 #[doc = "Current waypoint number"]
15459 pub wp_num: u16,
15460 #[doc = "Bitmap of failure flags."]
15461 pub failure_flags: HlFailureFlag,
15462 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15463 pub mavtype: MavType,
15464 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15465 pub autopilot: MavAutopilot,
15466 #[doc = "Heading"]
15467 pub heading: u8,
15468 #[doc = "Heading setpoint"]
15469 pub target_heading: u8,
15470 #[doc = "Throttle"]
15471 pub throttle: u8,
15472 #[doc = "Airspeed"]
15473 pub airspeed: u8,
15474 #[doc = "Airspeed setpoint"]
15475 pub airspeed_sp: u8,
15476 #[doc = "Groundspeed"]
15477 pub groundspeed: u8,
15478 #[doc = "Windspeed"]
15479 pub windspeed: u8,
15480 #[doc = "Wind heading"]
15481 pub wind_heading: u8,
15482 #[doc = "Maximum error horizontal position since last message"]
15483 pub eph: u8,
15484 #[doc = "Maximum error vertical position since last message"]
15485 pub epv: u8,
15486 #[doc = "Air temperature"]
15487 pub temperature_air: i8,
15488 #[doc = "Maximum climb rate magnitude since last message"]
15489 pub climb_rate: i8,
15490 #[doc = "Battery level (-1 if field not provided)."]
15491 pub battery: i8,
15492 #[doc = "Field for custom payload."]
15493 pub custom0: i8,
15494 #[doc = "Field for custom payload."]
15495 pub custom1: i8,
15496 #[doc = "Field for custom payload."]
15497 pub custom2: i8,
15498}
15499impl HIGH_LATENCY2_DATA {
15500 pub const ENCODED_LEN: usize = 42usize;
15501 pub const DEFAULT: Self = Self {
15502 timestamp: 0_u32,
15503 latitude: 0_i32,
15504 longitude: 0_i32,
15505 custom_mode: 0_u16,
15506 altitude: 0_i16,
15507 target_altitude: 0_i16,
15508 target_distance: 0_u16,
15509 wp_num: 0_u16,
15510 failure_flags: HlFailureFlag::DEFAULT,
15511 mavtype: MavType::DEFAULT,
15512 autopilot: MavAutopilot::DEFAULT,
15513 heading: 0_u8,
15514 target_heading: 0_u8,
15515 throttle: 0_u8,
15516 airspeed: 0_u8,
15517 airspeed_sp: 0_u8,
15518 groundspeed: 0_u8,
15519 windspeed: 0_u8,
15520 wind_heading: 0_u8,
15521 eph: 0_u8,
15522 epv: 0_u8,
15523 temperature_air: 0_i8,
15524 climb_rate: 0_i8,
15525 battery: 0_i8,
15526 custom0: 0_i8,
15527 custom1: 0_i8,
15528 custom2: 0_i8,
15529 };
15530 #[cfg(feature = "arbitrary")]
15531 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15532 use arbitrary::{Arbitrary, Unstructured};
15533 let mut buf = [0u8; 1024];
15534 rng.fill_bytes(&mut buf);
15535 let mut unstructured = Unstructured::new(&buf);
15536 Self::arbitrary(&mut unstructured).unwrap_or_default()
15537 }
15538}
15539impl Default for HIGH_LATENCY2_DATA {
15540 fn default() -> Self {
15541 Self::DEFAULT.clone()
15542 }
15543}
15544impl MessageData for HIGH_LATENCY2_DATA {
15545 type Message = MavMessage;
15546 const ID: u32 = 235u32;
15547 const NAME: &'static str = "HIGH_LATENCY2";
15548 const EXTRA_CRC: u8 = 179u8;
15549 const ENCODED_LEN: usize = 42usize;
15550 fn deser(
15551 _version: MavlinkVersion,
15552 __input: &[u8],
15553 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15554 let avail_len = __input.len();
15555 let mut payload_buf = [0; Self::ENCODED_LEN];
15556 let mut buf = if avail_len < Self::ENCODED_LEN {
15557 payload_buf[0..avail_len].copy_from_slice(__input);
15558 Bytes::new(&payload_buf)
15559 } else {
15560 Bytes::new(__input)
15561 };
15562 let mut __struct = Self::default();
15563 __struct.timestamp = buf.get_u32_le();
15564 __struct.latitude = buf.get_i32_le();
15565 __struct.longitude = buf.get_i32_le();
15566 __struct.custom_mode = buf.get_u16_le();
15567 __struct.altitude = buf.get_i16_le();
15568 __struct.target_altitude = buf.get_i16_le();
15569 __struct.target_distance = buf.get_u16_le();
15570 __struct.wp_num = buf.get_u16_le();
15571 let tmp = buf.get_u16_le();
15572 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15573 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15574 flag_type: "HlFailureFlag",
15575 value: tmp as u32,
15576 })?;
15577 let tmp = buf.get_u8();
15578 __struct.mavtype =
15579 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15580 enum_type: "MavType",
15581 value: tmp as u32,
15582 })?;
15583 let tmp = buf.get_u8();
15584 __struct.autopilot =
15585 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15586 enum_type: "MavAutopilot",
15587 value: tmp as u32,
15588 })?;
15589 __struct.heading = buf.get_u8();
15590 __struct.target_heading = buf.get_u8();
15591 __struct.throttle = buf.get_u8();
15592 __struct.airspeed = buf.get_u8();
15593 __struct.airspeed_sp = buf.get_u8();
15594 __struct.groundspeed = buf.get_u8();
15595 __struct.windspeed = buf.get_u8();
15596 __struct.wind_heading = buf.get_u8();
15597 __struct.eph = buf.get_u8();
15598 __struct.epv = buf.get_u8();
15599 __struct.temperature_air = buf.get_i8();
15600 __struct.climb_rate = buf.get_i8();
15601 __struct.battery = buf.get_i8();
15602 __struct.custom0 = buf.get_i8();
15603 __struct.custom1 = buf.get_i8();
15604 __struct.custom2 = buf.get_i8();
15605 Ok(__struct)
15606 }
15607 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15608 let mut __tmp = BytesMut::new(bytes);
15609 #[allow(clippy::absurd_extreme_comparisons)]
15610 #[allow(unused_comparisons)]
15611 if __tmp.remaining() < Self::ENCODED_LEN {
15612 panic!(
15613 "buffer is too small (need {} bytes, but got {})",
15614 Self::ENCODED_LEN,
15615 __tmp.remaining(),
15616 )
15617 }
15618 __tmp.put_u32_le(self.timestamp);
15619 __tmp.put_i32_le(self.latitude);
15620 __tmp.put_i32_le(self.longitude);
15621 __tmp.put_u16_le(self.custom_mode);
15622 __tmp.put_i16_le(self.altitude);
15623 __tmp.put_i16_le(self.target_altitude);
15624 __tmp.put_u16_le(self.target_distance);
15625 __tmp.put_u16_le(self.wp_num);
15626 __tmp.put_u16_le(self.failure_flags.bits());
15627 __tmp.put_u8(self.mavtype as u8);
15628 __tmp.put_u8(self.autopilot as u8);
15629 __tmp.put_u8(self.heading);
15630 __tmp.put_u8(self.target_heading);
15631 __tmp.put_u8(self.throttle);
15632 __tmp.put_u8(self.airspeed);
15633 __tmp.put_u8(self.airspeed_sp);
15634 __tmp.put_u8(self.groundspeed);
15635 __tmp.put_u8(self.windspeed);
15636 __tmp.put_u8(self.wind_heading);
15637 __tmp.put_u8(self.eph);
15638 __tmp.put_u8(self.epv);
15639 __tmp.put_i8(self.temperature_air);
15640 __tmp.put_i8(self.climb_rate);
15641 __tmp.put_i8(self.battery);
15642 __tmp.put_i8(self.custom0);
15643 __tmp.put_i8(self.custom1);
15644 __tmp.put_i8(self.custom2);
15645 if matches!(version, MavlinkVersion::V2) {
15646 let len = __tmp.len();
15647 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15648 } else {
15649 __tmp.len()
15650 }
15651 }
15652}
15653#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15654#[doc = ""]
15655#[doc = "ID: 93"]
15656#[derive(Debug, Clone, PartialEq)]
15657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15659#[cfg_attr(feature = "ts", derive(TS))]
15660#[cfg_attr(feature = "ts", ts(export))]
15661pub struct HIL_ACTUATOR_CONTROLS_DATA {
15662 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15663 pub time_usec: u64,
15664 #[doc = "Flags bitmask."]
15665 pub flags: HilActuatorControlsFlags,
15666 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15667 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15668 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15669 pub controls: [f32; 16],
15670 #[doc = "System mode. Includes arming state."]
15671 pub mode: MavModeFlag,
15672}
15673impl HIL_ACTUATOR_CONTROLS_DATA {
15674 pub const ENCODED_LEN: usize = 81usize;
15675 pub const DEFAULT: Self = Self {
15676 time_usec: 0_u64,
15677 flags: HilActuatorControlsFlags::DEFAULT,
15678 controls: [0.0_f32; 16usize],
15679 mode: MavModeFlag::DEFAULT,
15680 };
15681 #[cfg(feature = "arbitrary")]
15682 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15683 use arbitrary::{Arbitrary, Unstructured};
15684 let mut buf = [0u8; 1024];
15685 rng.fill_bytes(&mut buf);
15686 let mut unstructured = Unstructured::new(&buf);
15687 Self::arbitrary(&mut unstructured).unwrap_or_default()
15688 }
15689}
15690impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15691 fn default() -> Self {
15692 Self::DEFAULT.clone()
15693 }
15694}
15695impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15696 type Message = MavMessage;
15697 const ID: u32 = 93u32;
15698 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15699 const EXTRA_CRC: u8 = 47u8;
15700 const ENCODED_LEN: usize = 81usize;
15701 fn deser(
15702 _version: MavlinkVersion,
15703 __input: &[u8],
15704 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15705 let avail_len = __input.len();
15706 let mut payload_buf = [0; Self::ENCODED_LEN];
15707 let mut buf = if avail_len < Self::ENCODED_LEN {
15708 payload_buf[0..avail_len].copy_from_slice(__input);
15709 Bytes::new(&payload_buf)
15710 } else {
15711 Bytes::new(__input)
15712 };
15713 let mut __struct = Self::default();
15714 __struct.time_usec = buf.get_u64_le();
15715 let tmp = buf.get_u64_le();
15716 __struct.flags =
15717 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15718 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15719 flag_type: "HilActuatorControlsFlags",
15720 value: tmp as u32,
15721 })?;
15722 for v in &mut __struct.controls {
15723 let val = buf.get_f32_le();
15724 *v = val;
15725 }
15726 let tmp = buf.get_u8();
15727 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15728 ::mavlink_core::error::ParserError::InvalidFlag {
15729 flag_type: "MavModeFlag",
15730 value: tmp as u32,
15731 },
15732 )?;
15733 Ok(__struct)
15734 }
15735 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15736 let mut __tmp = BytesMut::new(bytes);
15737 #[allow(clippy::absurd_extreme_comparisons)]
15738 #[allow(unused_comparisons)]
15739 if __tmp.remaining() < Self::ENCODED_LEN {
15740 panic!(
15741 "buffer is too small (need {} bytes, but got {})",
15742 Self::ENCODED_LEN,
15743 __tmp.remaining(),
15744 )
15745 }
15746 __tmp.put_u64_le(self.time_usec);
15747 __tmp.put_u64_le(self.flags.bits());
15748 for val in &self.controls {
15749 __tmp.put_f32_le(*val);
15750 }
15751 __tmp.put_u8(self.mode.bits());
15752 if matches!(version, MavlinkVersion::V2) {
15753 let len = __tmp.len();
15754 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15755 } else {
15756 __tmp.len()
15757 }
15758 }
15759}
15760#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15761#[doc = ""]
15762#[doc = "ID: 91"]
15763#[derive(Debug, Clone, PartialEq)]
15764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15766#[cfg_attr(feature = "ts", derive(TS))]
15767#[cfg_attr(feature = "ts", ts(export))]
15768pub struct HIL_CONTROLS_DATA {
15769 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15770 pub time_usec: u64,
15771 #[doc = "Control output -1 .. 1"]
15772 pub roll_ailerons: f32,
15773 #[doc = "Control output -1 .. 1"]
15774 pub pitch_elevator: f32,
15775 #[doc = "Control output -1 .. 1"]
15776 pub yaw_rudder: f32,
15777 #[doc = "Throttle 0 .. 1"]
15778 pub throttle: f32,
15779 #[doc = "Aux 1, -1 .. 1"]
15780 pub aux1: f32,
15781 #[doc = "Aux 2, -1 .. 1"]
15782 pub aux2: f32,
15783 #[doc = "Aux 3, -1 .. 1"]
15784 pub aux3: f32,
15785 #[doc = "Aux 4, -1 .. 1"]
15786 pub aux4: f32,
15787 #[doc = "System mode."]
15788 pub mode: MavMode,
15789 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15790 pub nav_mode: u8,
15791}
15792impl HIL_CONTROLS_DATA {
15793 pub const ENCODED_LEN: usize = 42usize;
15794 pub const DEFAULT: Self = Self {
15795 time_usec: 0_u64,
15796 roll_ailerons: 0.0_f32,
15797 pitch_elevator: 0.0_f32,
15798 yaw_rudder: 0.0_f32,
15799 throttle: 0.0_f32,
15800 aux1: 0.0_f32,
15801 aux2: 0.0_f32,
15802 aux3: 0.0_f32,
15803 aux4: 0.0_f32,
15804 mode: MavMode::DEFAULT,
15805 nav_mode: 0_u8,
15806 };
15807 #[cfg(feature = "arbitrary")]
15808 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15809 use arbitrary::{Arbitrary, Unstructured};
15810 let mut buf = [0u8; 1024];
15811 rng.fill_bytes(&mut buf);
15812 let mut unstructured = Unstructured::new(&buf);
15813 Self::arbitrary(&mut unstructured).unwrap_or_default()
15814 }
15815}
15816impl Default for HIL_CONTROLS_DATA {
15817 fn default() -> Self {
15818 Self::DEFAULT.clone()
15819 }
15820}
15821impl MessageData for HIL_CONTROLS_DATA {
15822 type Message = MavMessage;
15823 const ID: u32 = 91u32;
15824 const NAME: &'static str = "HIL_CONTROLS";
15825 const EXTRA_CRC: u8 = 63u8;
15826 const ENCODED_LEN: usize = 42usize;
15827 fn deser(
15828 _version: MavlinkVersion,
15829 __input: &[u8],
15830 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15831 let avail_len = __input.len();
15832 let mut payload_buf = [0; Self::ENCODED_LEN];
15833 let mut buf = if avail_len < Self::ENCODED_LEN {
15834 payload_buf[0..avail_len].copy_from_slice(__input);
15835 Bytes::new(&payload_buf)
15836 } else {
15837 Bytes::new(__input)
15838 };
15839 let mut __struct = Self::default();
15840 __struct.time_usec = buf.get_u64_le();
15841 __struct.roll_ailerons = buf.get_f32_le();
15842 __struct.pitch_elevator = buf.get_f32_le();
15843 __struct.yaw_rudder = buf.get_f32_le();
15844 __struct.throttle = buf.get_f32_le();
15845 __struct.aux1 = buf.get_f32_le();
15846 __struct.aux2 = buf.get_f32_le();
15847 __struct.aux3 = buf.get_f32_le();
15848 __struct.aux4 = buf.get_f32_le();
15849 let tmp = buf.get_u8();
15850 __struct.mode =
15851 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15852 enum_type: "MavMode",
15853 value: tmp as u32,
15854 })?;
15855 __struct.nav_mode = buf.get_u8();
15856 Ok(__struct)
15857 }
15858 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15859 let mut __tmp = BytesMut::new(bytes);
15860 #[allow(clippy::absurd_extreme_comparisons)]
15861 #[allow(unused_comparisons)]
15862 if __tmp.remaining() < Self::ENCODED_LEN {
15863 panic!(
15864 "buffer is too small (need {} bytes, but got {})",
15865 Self::ENCODED_LEN,
15866 __tmp.remaining(),
15867 )
15868 }
15869 __tmp.put_u64_le(self.time_usec);
15870 __tmp.put_f32_le(self.roll_ailerons);
15871 __tmp.put_f32_le(self.pitch_elevator);
15872 __tmp.put_f32_le(self.yaw_rudder);
15873 __tmp.put_f32_le(self.throttle);
15874 __tmp.put_f32_le(self.aux1);
15875 __tmp.put_f32_le(self.aux2);
15876 __tmp.put_f32_le(self.aux3);
15877 __tmp.put_f32_le(self.aux4);
15878 __tmp.put_u8(self.mode as u8);
15879 __tmp.put_u8(self.nav_mode);
15880 if matches!(version, MavlinkVersion::V2) {
15881 let len = __tmp.len();
15882 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15883 } else {
15884 __tmp.len()
15885 }
15886 }
15887}
15888#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15889#[doc = ""]
15890#[doc = "ID: 113"]
15891#[derive(Debug, Clone, PartialEq)]
15892#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15893#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15894#[cfg_attr(feature = "ts", derive(TS))]
15895#[cfg_attr(feature = "ts", ts(export))]
15896pub struct HIL_GPS_DATA {
15897 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15898 pub time_usec: u64,
15899 #[doc = "Latitude (WGS84)"]
15900 pub lat: i32,
15901 #[doc = "Longitude (WGS84)"]
15902 pub lon: i32,
15903 #[doc = "Altitude (MSL). Positive for up."]
15904 pub alt: i32,
15905 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15906 pub eph: u16,
15907 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15908 pub epv: u16,
15909 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15910 pub vel: u16,
15911 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15912 pub vn: i16,
15913 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15914 pub ve: i16,
15915 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15916 pub vd: i16,
15917 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15918 pub cog: u16,
15919 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15920 pub fix_type: u8,
15921 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15922 pub satellites_visible: u8,
15923 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15924 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15925 pub id: u8,
15926 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15927 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15928 pub yaw: u16,
15929}
15930impl HIL_GPS_DATA {
15931 pub const ENCODED_LEN: usize = 39usize;
15932 pub const DEFAULT: Self = Self {
15933 time_usec: 0_u64,
15934 lat: 0_i32,
15935 lon: 0_i32,
15936 alt: 0_i32,
15937 eph: 0_u16,
15938 epv: 0_u16,
15939 vel: 0_u16,
15940 vn: 0_i16,
15941 ve: 0_i16,
15942 vd: 0_i16,
15943 cog: 0_u16,
15944 fix_type: 0_u8,
15945 satellites_visible: 0_u8,
15946 id: 0_u8,
15947 yaw: 0_u16,
15948 };
15949 #[cfg(feature = "arbitrary")]
15950 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15951 use arbitrary::{Arbitrary, Unstructured};
15952 let mut buf = [0u8; 1024];
15953 rng.fill_bytes(&mut buf);
15954 let mut unstructured = Unstructured::new(&buf);
15955 Self::arbitrary(&mut unstructured).unwrap_or_default()
15956 }
15957}
15958impl Default for HIL_GPS_DATA {
15959 fn default() -> Self {
15960 Self::DEFAULT.clone()
15961 }
15962}
15963impl MessageData for HIL_GPS_DATA {
15964 type Message = MavMessage;
15965 const ID: u32 = 113u32;
15966 const NAME: &'static str = "HIL_GPS";
15967 const EXTRA_CRC: u8 = 124u8;
15968 const ENCODED_LEN: usize = 39usize;
15969 fn deser(
15970 _version: MavlinkVersion,
15971 __input: &[u8],
15972 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15973 let avail_len = __input.len();
15974 let mut payload_buf = [0; Self::ENCODED_LEN];
15975 let mut buf = if avail_len < Self::ENCODED_LEN {
15976 payload_buf[0..avail_len].copy_from_slice(__input);
15977 Bytes::new(&payload_buf)
15978 } else {
15979 Bytes::new(__input)
15980 };
15981 let mut __struct = Self::default();
15982 __struct.time_usec = buf.get_u64_le();
15983 __struct.lat = buf.get_i32_le();
15984 __struct.lon = buf.get_i32_le();
15985 __struct.alt = buf.get_i32_le();
15986 __struct.eph = buf.get_u16_le();
15987 __struct.epv = buf.get_u16_le();
15988 __struct.vel = buf.get_u16_le();
15989 __struct.vn = buf.get_i16_le();
15990 __struct.ve = buf.get_i16_le();
15991 __struct.vd = buf.get_i16_le();
15992 __struct.cog = buf.get_u16_le();
15993 __struct.fix_type = buf.get_u8();
15994 __struct.satellites_visible = buf.get_u8();
15995 __struct.id = buf.get_u8();
15996 __struct.yaw = buf.get_u16_le();
15997 Ok(__struct)
15998 }
15999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16000 let mut __tmp = BytesMut::new(bytes);
16001 #[allow(clippy::absurd_extreme_comparisons)]
16002 #[allow(unused_comparisons)]
16003 if __tmp.remaining() < Self::ENCODED_LEN {
16004 panic!(
16005 "buffer is too small (need {} bytes, but got {})",
16006 Self::ENCODED_LEN,
16007 __tmp.remaining(),
16008 )
16009 }
16010 __tmp.put_u64_le(self.time_usec);
16011 __tmp.put_i32_le(self.lat);
16012 __tmp.put_i32_le(self.lon);
16013 __tmp.put_i32_le(self.alt);
16014 __tmp.put_u16_le(self.eph);
16015 __tmp.put_u16_le(self.epv);
16016 __tmp.put_u16_le(self.vel);
16017 __tmp.put_i16_le(self.vn);
16018 __tmp.put_i16_le(self.ve);
16019 __tmp.put_i16_le(self.vd);
16020 __tmp.put_u16_le(self.cog);
16021 __tmp.put_u8(self.fix_type);
16022 __tmp.put_u8(self.satellites_visible);
16023 if matches!(version, MavlinkVersion::V2) {
16024 __tmp.put_u8(self.id);
16025 __tmp.put_u16_le(self.yaw);
16026 let len = __tmp.len();
16027 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16028 } else {
16029 __tmp.len()
16030 }
16031 }
16032}
16033#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16034#[doc = ""]
16035#[doc = "ID: 114"]
16036#[derive(Debug, Clone, PartialEq)]
16037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16038#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16039#[cfg_attr(feature = "ts", derive(TS))]
16040#[cfg_attr(feature = "ts", ts(export))]
16041pub struct HIL_OPTICAL_FLOW_DATA {
16042 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16043 pub time_usec: u64,
16044 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16045 pub integration_time_us: u32,
16046 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16047 pub integrated_x: f32,
16048 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16049 pub integrated_y: f32,
16050 #[doc = "RH rotation around X axis"]
16051 pub integrated_xgyro: f32,
16052 #[doc = "RH rotation around Y axis"]
16053 pub integrated_ygyro: f32,
16054 #[doc = "RH rotation around Z axis"]
16055 pub integrated_zgyro: f32,
16056 #[doc = "Time since the distance was sampled."]
16057 pub time_delta_distance_us: u32,
16058 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16059 pub distance: f32,
16060 #[doc = "Temperature"]
16061 pub temperature: i16,
16062 #[doc = "Sensor ID"]
16063 pub sensor_id: u8,
16064 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16065 pub quality: u8,
16066}
16067impl HIL_OPTICAL_FLOW_DATA {
16068 pub const ENCODED_LEN: usize = 44usize;
16069 pub const DEFAULT: Self = Self {
16070 time_usec: 0_u64,
16071 integration_time_us: 0_u32,
16072 integrated_x: 0.0_f32,
16073 integrated_y: 0.0_f32,
16074 integrated_xgyro: 0.0_f32,
16075 integrated_ygyro: 0.0_f32,
16076 integrated_zgyro: 0.0_f32,
16077 time_delta_distance_us: 0_u32,
16078 distance: 0.0_f32,
16079 temperature: 0_i16,
16080 sensor_id: 0_u8,
16081 quality: 0_u8,
16082 };
16083 #[cfg(feature = "arbitrary")]
16084 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16085 use arbitrary::{Arbitrary, Unstructured};
16086 let mut buf = [0u8; 1024];
16087 rng.fill_bytes(&mut buf);
16088 let mut unstructured = Unstructured::new(&buf);
16089 Self::arbitrary(&mut unstructured).unwrap_or_default()
16090 }
16091}
16092impl Default for HIL_OPTICAL_FLOW_DATA {
16093 fn default() -> Self {
16094 Self::DEFAULT.clone()
16095 }
16096}
16097impl MessageData for HIL_OPTICAL_FLOW_DATA {
16098 type Message = MavMessage;
16099 const ID: u32 = 114u32;
16100 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16101 const EXTRA_CRC: u8 = 237u8;
16102 const ENCODED_LEN: usize = 44usize;
16103 fn deser(
16104 _version: MavlinkVersion,
16105 __input: &[u8],
16106 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16107 let avail_len = __input.len();
16108 let mut payload_buf = [0; Self::ENCODED_LEN];
16109 let mut buf = if avail_len < Self::ENCODED_LEN {
16110 payload_buf[0..avail_len].copy_from_slice(__input);
16111 Bytes::new(&payload_buf)
16112 } else {
16113 Bytes::new(__input)
16114 };
16115 let mut __struct = Self::default();
16116 __struct.time_usec = buf.get_u64_le();
16117 __struct.integration_time_us = buf.get_u32_le();
16118 __struct.integrated_x = buf.get_f32_le();
16119 __struct.integrated_y = buf.get_f32_le();
16120 __struct.integrated_xgyro = buf.get_f32_le();
16121 __struct.integrated_ygyro = buf.get_f32_le();
16122 __struct.integrated_zgyro = buf.get_f32_le();
16123 __struct.time_delta_distance_us = buf.get_u32_le();
16124 __struct.distance = buf.get_f32_le();
16125 __struct.temperature = buf.get_i16_le();
16126 __struct.sensor_id = buf.get_u8();
16127 __struct.quality = buf.get_u8();
16128 Ok(__struct)
16129 }
16130 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16131 let mut __tmp = BytesMut::new(bytes);
16132 #[allow(clippy::absurd_extreme_comparisons)]
16133 #[allow(unused_comparisons)]
16134 if __tmp.remaining() < Self::ENCODED_LEN {
16135 panic!(
16136 "buffer is too small (need {} bytes, but got {})",
16137 Self::ENCODED_LEN,
16138 __tmp.remaining(),
16139 )
16140 }
16141 __tmp.put_u64_le(self.time_usec);
16142 __tmp.put_u32_le(self.integration_time_us);
16143 __tmp.put_f32_le(self.integrated_x);
16144 __tmp.put_f32_le(self.integrated_y);
16145 __tmp.put_f32_le(self.integrated_xgyro);
16146 __tmp.put_f32_le(self.integrated_ygyro);
16147 __tmp.put_f32_le(self.integrated_zgyro);
16148 __tmp.put_u32_le(self.time_delta_distance_us);
16149 __tmp.put_f32_le(self.distance);
16150 __tmp.put_i16_le(self.temperature);
16151 __tmp.put_u8(self.sensor_id);
16152 __tmp.put_u8(self.quality);
16153 if matches!(version, MavlinkVersion::V2) {
16154 let len = __tmp.len();
16155 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16156 } else {
16157 __tmp.len()
16158 }
16159 }
16160}
16161#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16162#[doc = ""]
16163#[doc = "ID: 92"]
16164#[derive(Debug, Clone, PartialEq)]
16165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16167#[cfg_attr(feature = "ts", derive(TS))]
16168#[cfg_attr(feature = "ts", ts(export))]
16169pub struct HIL_RC_INPUTS_RAW_DATA {
16170 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16171 pub time_usec: u64,
16172 #[doc = "RC channel 1 value"]
16173 pub chan1_raw: u16,
16174 #[doc = "RC channel 2 value"]
16175 pub chan2_raw: u16,
16176 #[doc = "RC channel 3 value"]
16177 pub chan3_raw: u16,
16178 #[doc = "RC channel 4 value"]
16179 pub chan4_raw: u16,
16180 #[doc = "RC channel 5 value"]
16181 pub chan5_raw: u16,
16182 #[doc = "RC channel 6 value"]
16183 pub chan6_raw: u16,
16184 #[doc = "RC channel 7 value"]
16185 pub chan7_raw: u16,
16186 #[doc = "RC channel 8 value"]
16187 pub chan8_raw: u16,
16188 #[doc = "RC channel 9 value"]
16189 pub chan9_raw: u16,
16190 #[doc = "RC channel 10 value"]
16191 pub chan10_raw: u16,
16192 #[doc = "RC channel 11 value"]
16193 pub chan11_raw: u16,
16194 #[doc = "RC channel 12 value"]
16195 pub chan12_raw: u16,
16196 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16197 pub rssi: u8,
16198}
16199impl HIL_RC_INPUTS_RAW_DATA {
16200 pub const ENCODED_LEN: usize = 33usize;
16201 pub const DEFAULT: Self = Self {
16202 time_usec: 0_u64,
16203 chan1_raw: 0_u16,
16204 chan2_raw: 0_u16,
16205 chan3_raw: 0_u16,
16206 chan4_raw: 0_u16,
16207 chan5_raw: 0_u16,
16208 chan6_raw: 0_u16,
16209 chan7_raw: 0_u16,
16210 chan8_raw: 0_u16,
16211 chan9_raw: 0_u16,
16212 chan10_raw: 0_u16,
16213 chan11_raw: 0_u16,
16214 chan12_raw: 0_u16,
16215 rssi: 0_u8,
16216 };
16217 #[cfg(feature = "arbitrary")]
16218 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16219 use arbitrary::{Arbitrary, Unstructured};
16220 let mut buf = [0u8; 1024];
16221 rng.fill_bytes(&mut buf);
16222 let mut unstructured = Unstructured::new(&buf);
16223 Self::arbitrary(&mut unstructured).unwrap_or_default()
16224 }
16225}
16226impl Default for HIL_RC_INPUTS_RAW_DATA {
16227 fn default() -> Self {
16228 Self::DEFAULT.clone()
16229 }
16230}
16231impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16232 type Message = MavMessage;
16233 const ID: u32 = 92u32;
16234 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16235 const EXTRA_CRC: u8 = 54u8;
16236 const ENCODED_LEN: usize = 33usize;
16237 fn deser(
16238 _version: MavlinkVersion,
16239 __input: &[u8],
16240 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16241 let avail_len = __input.len();
16242 let mut payload_buf = [0; Self::ENCODED_LEN];
16243 let mut buf = if avail_len < Self::ENCODED_LEN {
16244 payload_buf[0..avail_len].copy_from_slice(__input);
16245 Bytes::new(&payload_buf)
16246 } else {
16247 Bytes::new(__input)
16248 };
16249 let mut __struct = Self::default();
16250 __struct.time_usec = buf.get_u64_le();
16251 __struct.chan1_raw = buf.get_u16_le();
16252 __struct.chan2_raw = buf.get_u16_le();
16253 __struct.chan3_raw = buf.get_u16_le();
16254 __struct.chan4_raw = buf.get_u16_le();
16255 __struct.chan5_raw = buf.get_u16_le();
16256 __struct.chan6_raw = buf.get_u16_le();
16257 __struct.chan7_raw = buf.get_u16_le();
16258 __struct.chan8_raw = buf.get_u16_le();
16259 __struct.chan9_raw = buf.get_u16_le();
16260 __struct.chan10_raw = buf.get_u16_le();
16261 __struct.chan11_raw = buf.get_u16_le();
16262 __struct.chan12_raw = buf.get_u16_le();
16263 __struct.rssi = buf.get_u8();
16264 Ok(__struct)
16265 }
16266 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16267 let mut __tmp = BytesMut::new(bytes);
16268 #[allow(clippy::absurd_extreme_comparisons)]
16269 #[allow(unused_comparisons)]
16270 if __tmp.remaining() < Self::ENCODED_LEN {
16271 panic!(
16272 "buffer is too small (need {} bytes, but got {})",
16273 Self::ENCODED_LEN,
16274 __tmp.remaining(),
16275 )
16276 }
16277 __tmp.put_u64_le(self.time_usec);
16278 __tmp.put_u16_le(self.chan1_raw);
16279 __tmp.put_u16_le(self.chan2_raw);
16280 __tmp.put_u16_le(self.chan3_raw);
16281 __tmp.put_u16_le(self.chan4_raw);
16282 __tmp.put_u16_le(self.chan5_raw);
16283 __tmp.put_u16_le(self.chan6_raw);
16284 __tmp.put_u16_le(self.chan7_raw);
16285 __tmp.put_u16_le(self.chan8_raw);
16286 __tmp.put_u16_le(self.chan9_raw);
16287 __tmp.put_u16_le(self.chan10_raw);
16288 __tmp.put_u16_le(self.chan11_raw);
16289 __tmp.put_u16_le(self.chan12_raw);
16290 __tmp.put_u8(self.rssi);
16291 if matches!(version, MavlinkVersion::V2) {
16292 let len = __tmp.len();
16293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16294 } else {
16295 __tmp.len()
16296 }
16297 }
16298}
16299#[doc = "The IMU readings in SI units in NED body frame."]
16300#[doc = ""]
16301#[doc = "ID: 107"]
16302#[derive(Debug, Clone, PartialEq)]
16303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16305#[cfg_attr(feature = "ts", derive(TS))]
16306#[cfg_attr(feature = "ts", ts(export))]
16307pub struct HIL_SENSOR_DATA {
16308 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16309 pub time_usec: u64,
16310 #[doc = "X acceleration"]
16311 pub xacc: f32,
16312 #[doc = "Y acceleration"]
16313 pub yacc: f32,
16314 #[doc = "Z acceleration"]
16315 pub zacc: f32,
16316 #[doc = "Angular speed around X axis in body frame"]
16317 pub xgyro: f32,
16318 #[doc = "Angular speed around Y axis in body frame"]
16319 pub ygyro: f32,
16320 #[doc = "Angular speed around Z axis in body frame"]
16321 pub zgyro: f32,
16322 #[doc = "X Magnetic field"]
16323 pub xmag: f32,
16324 #[doc = "Y Magnetic field"]
16325 pub ymag: f32,
16326 #[doc = "Z Magnetic field"]
16327 pub zmag: f32,
16328 #[doc = "Absolute pressure"]
16329 pub abs_pressure: f32,
16330 #[doc = "Differential pressure (airspeed)"]
16331 pub diff_pressure: f32,
16332 #[doc = "Altitude calculated from pressure"]
16333 pub pressure_alt: f32,
16334 #[doc = "Temperature"]
16335 pub temperature: f32,
16336 #[doc = "Bitmap for fields that have updated since last message"]
16337 pub fields_updated: HilSensorUpdatedFlags,
16338 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16339 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16340 pub id: u8,
16341}
16342impl HIL_SENSOR_DATA {
16343 pub const ENCODED_LEN: usize = 65usize;
16344 pub const DEFAULT: Self = Self {
16345 time_usec: 0_u64,
16346 xacc: 0.0_f32,
16347 yacc: 0.0_f32,
16348 zacc: 0.0_f32,
16349 xgyro: 0.0_f32,
16350 ygyro: 0.0_f32,
16351 zgyro: 0.0_f32,
16352 xmag: 0.0_f32,
16353 ymag: 0.0_f32,
16354 zmag: 0.0_f32,
16355 abs_pressure: 0.0_f32,
16356 diff_pressure: 0.0_f32,
16357 pressure_alt: 0.0_f32,
16358 temperature: 0.0_f32,
16359 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16360 id: 0_u8,
16361 };
16362 #[cfg(feature = "arbitrary")]
16363 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16364 use arbitrary::{Arbitrary, Unstructured};
16365 let mut buf = [0u8; 1024];
16366 rng.fill_bytes(&mut buf);
16367 let mut unstructured = Unstructured::new(&buf);
16368 Self::arbitrary(&mut unstructured).unwrap_or_default()
16369 }
16370}
16371impl Default for HIL_SENSOR_DATA {
16372 fn default() -> Self {
16373 Self::DEFAULT.clone()
16374 }
16375}
16376impl MessageData for HIL_SENSOR_DATA {
16377 type Message = MavMessage;
16378 const ID: u32 = 107u32;
16379 const NAME: &'static str = "HIL_SENSOR";
16380 const EXTRA_CRC: u8 = 108u8;
16381 const ENCODED_LEN: usize = 65usize;
16382 fn deser(
16383 _version: MavlinkVersion,
16384 __input: &[u8],
16385 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16386 let avail_len = __input.len();
16387 let mut payload_buf = [0; Self::ENCODED_LEN];
16388 let mut buf = if avail_len < Self::ENCODED_LEN {
16389 payload_buf[0..avail_len].copy_from_slice(__input);
16390 Bytes::new(&payload_buf)
16391 } else {
16392 Bytes::new(__input)
16393 };
16394 let mut __struct = Self::default();
16395 __struct.time_usec = buf.get_u64_le();
16396 __struct.xacc = buf.get_f32_le();
16397 __struct.yacc = buf.get_f32_le();
16398 __struct.zacc = buf.get_f32_le();
16399 __struct.xgyro = buf.get_f32_le();
16400 __struct.ygyro = buf.get_f32_le();
16401 __struct.zgyro = buf.get_f32_le();
16402 __struct.xmag = buf.get_f32_le();
16403 __struct.ymag = buf.get_f32_le();
16404 __struct.zmag = buf.get_f32_le();
16405 __struct.abs_pressure = buf.get_f32_le();
16406 __struct.diff_pressure = buf.get_f32_le();
16407 __struct.pressure_alt = buf.get_f32_le();
16408 __struct.temperature = buf.get_f32_le();
16409 let tmp = buf.get_u32_le();
16410 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16411 tmp & HilSensorUpdatedFlags::all().bits(),
16412 )
16413 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16414 flag_type: "HilSensorUpdatedFlags",
16415 value: tmp as u32,
16416 })?;
16417 __struct.id = buf.get_u8();
16418 Ok(__struct)
16419 }
16420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16421 let mut __tmp = BytesMut::new(bytes);
16422 #[allow(clippy::absurd_extreme_comparisons)]
16423 #[allow(unused_comparisons)]
16424 if __tmp.remaining() < Self::ENCODED_LEN {
16425 panic!(
16426 "buffer is too small (need {} bytes, but got {})",
16427 Self::ENCODED_LEN,
16428 __tmp.remaining(),
16429 )
16430 }
16431 __tmp.put_u64_le(self.time_usec);
16432 __tmp.put_f32_le(self.xacc);
16433 __tmp.put_f32_le(self.yacc);
16434 __tmp.put_f32_le(self.zacc);
16435 __tmp.put_f32_le(self.xgyro);
16436 __tmp.put_f32_le(self.ygyro);
16437 __tmp.put_f32_le(self.zgyro);
16438 __tmp.put_f32_le(self.xmag);
16439 __tmp.put_f32_le(self.ymag);
16440 __tmp.put_f32_le(self.zmag);
16441 __tmp.put_f32_le(self.abs_pressure);
16442 __tmp.put_f32_le(self.diff_pressure);
16443 __tmp.put_f32_le(self.pressure_alt);
16444 __tmp.put_f32_le(self.temperature);
16445 __tmp.put_u32_le(self.fields_updated.bits());
16446 if matches!(version, MavlinkVersion::V2) {
16447 __tmp.put_u8(self.id);
16448 let len = __tmp.len();
16449 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16450 } else {
16451 __tmp.len()
16452 }
16453 }
16454}
16455#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16456#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16457#[doc = ""]
16458#[doc = "ID: 90"]
16459#[derive(Debug, Clone, PartialEq)]
16460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16462#[cfg_attr(feature = "ts", derive(TS))]
16463#[cfg_attr(feature = "ts", ts(export))]
16464pub struct HIL_STATE_DATA {
16465 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16466 pub time_usec: u64,
16467 #[doc = "Roll angle"]
16468 pub roll: f32,
16469 #[doc = "Pitch angle"]
16470 pub pitch: f32,
16471 #[doc = "Yaw angle"]
16472 pub yaw: f32,
16473 #[doc = "Body frame roll / phi angular speed"]
16474 pub rollspeed: f32,
16475 #[doc = "Body frame pitch / theta angular speed"]
16476 pub pitchspeed: f32,
16477 #[doc = "Body frame yaw / psi angular speed"]
16478 pub yawspeed: f32,
16479 #[doc = "Latitude"]
16480 pub lat: i32,
16481 #[doc = "Longitude"]
16482 pub lon: i32,
16483 #[doc = "Altitude"]
16484 pub alt: i32,
16485 #[doc = "Ground X Speed (Latitude)"]
16486 pub vx: i16,
16487 #[doc = "Ground Y Speed (Longitude)"]
16488 pub vy: i16,
16489 #[doc = "Ground Z Speed (Altitude)"]
16490 pub vz: i16,
16491 #[doc = "X acceleration"]
16492 pub xacc: i16,
16493 #[doc = "Y acceleration"]
16494 pub yacc: i16,
16495 #[doc = "Z acceleration"]
16496 pub zacc: i16,
16497}
16498impl HIL_STATE_DATA {
16499 pub const ENCODED_LEN: usize = 56usize;
16500 pub const DEFAULT: Self = Self {
16501 time_usec: 0_u64,
16502 roll: 0.0_f32,
16503 pitch: 0.0_f32,
16504 yaw: 0.0_f32,
16505 rollspeed: 0.0_f32,
16506 pitchspeed: 0.0_f32,
16507 yawspeed: 0.0_f32,
16508 lat: 0_i32,
16509 lon: 0_i32,
16510 alt: 0_i32,
16511 vx: 0_i16,
16512 vy: 0_i16,
16513 vz: 0_i16,
16514 xacc: 0_i16,
16515 yacc: 0_i16,
16516 zacc: 0_i16,
16517 };
16518 #[cfg(feature = "arbitrary")]
16519 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16520 use arbitrary::{Arbitrary, Unstructured};
16521 let mut buf = [0u8; 1024];
16522 rng.fill_bytes(&mut buf);
16523 let mut unstructured = Unstructured::new(&buf);
16524 Self::arbitrary(&mut unstructured).unwrap_or_default()
16525 }
16526}
16527impl Default for HIL_STATE_DATA {
16528 fn default() -> Self {
16529 Self::DEFAULT.clone()
16530 }
16531}
16532impl MessageData for HIL_STATE_DATA {
16533 type Message = MavMessage;
16534 const ID: u32 = 90u32;
16535 const NAME: &'static str = "HIL_STATE";
16536 const EXTRA_CRC: u8 = 183u8;
16537 const ENCODED_LEN: usize = 56usize;
16538 fn deser(
16539 _version: MavlinkVersion,
16540 __input: &[u8],
16541 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16542 let avail_len = __input.len();
16543 let mut payload_buf = [0; Self::ENCODED_LEN];
16544 let mut buf = if avail_len < Self::ENCODED_LEN {
16545 payload_buf[0..avail_len].copy_from_slice(__input);
16546 Bytes::new(&payload_buf)
16547 } else {
16548 Bytes::new(__input)
16549 };
16550 let mut __struct = Self::default();
16551 __struct.time_usec = buf.get_u64_le();
16552 __struct.roll = buf.get_f32_le();
16553 __struct.pitch = buf.get_f32_le();
16554 __struct.yaw = buf.get_f32_le();
16555 __struct.rollspeed = buf.get_f32_le();
16556 __struct.pitchspeed = buf.get_f32_le();
16557 __struct.yawspeed = buf.get_f32_le();
16558 __struct.lat = buf.get_i32_le();
16559 __struct.lon = buf.get_i32_le();
16560 __struct.alt = buf.get_i32_le();
16561 __struct.vx = buf.get_i16_le();
16562 __struct.vy = buf.get_i16_le();
16563 __struct.vz = buf.get_i16_le();
16564 __struct.xacc = buf.get_i16_le();
16565 __struct.yacc = buf.get_i16_le();
16566 __struct.zacc = buf.get_i16_le();
16567 Ok(__struct)
16568 }
16569 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16570 let mut __tmp = BytesMut::new(bytes);
16571 #[allow(clippy::absurd_extreme_comparisons)]
16572 #[allow(unused_comparisons)]
16573 if __tmp.remaining() < Self::ENCODED_LEN {
16574 panic!(
16575 "buffer is too small (need {} bytes, but got {})",
16576 Self::ENCODED_LEN,
16577 __tmp.remaining(),
16578 )
16579 }
16580 __tmp.put_u64_le(self.time_usec);
16581 __tmp.put_f32_le(self.roll);
16582 __tmp.put_f32_le(self.pitch);
16583 __tmp.put_f32_le(self.yaw);
16584 __tmp.put_f32_le(self.rollspeed);
16585 __tmp.put_f32_le(self.pitchspeed);
16586 __tmp.put_f32_le(self.yawspeed);
16587 __tmp.put_i32_le(self.lat);
16588 __tmp.put_i32_le(self.lon);
16589 __tmp.put_i32_le(self.alt);
16590 __tmp.put_i16_le(self.vx);
16591 __tmp.put_i16_le(self.vy);
16592 __tmp.put_i16_le(self.vz);
16593 __tmp.put_i16_le(self.xacc);
16594 __tmp.put_i16_le(self.yacc);
16595 __tmp.put_i16_le(self.zacc);
16596 if matches!(version, MavlinkVersion::V2) {
16597 let len = __tmp.len();
16598 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16599 } else {
16600 __tmp.len()
16601 }
16602 }
16603}
16604#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16605#[doc = ""]
16606#[doc = "ID: 115"]
16607#[derive(Debug, Clone, PartialEq)]
16608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16609#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16610#[cfg_attr(feature = "ts", derive(TS))]
16611#[cfg_attr(feature = "ts", ts(export))]
16612pub struct HIL_STATE_QUATERNION_DATA {
16613 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16614 pub time_usec: u64,
16615 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16616 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16617 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16618 pub attitude_quaternion: [f32; 4],
16619 #[doc = "Body frame roll / phi angular speed"]
16620 pub rollspeed: f32,
16621 #[doc = "Body frame pitch / theta angular speed"]
16622 pub pitchspeed: f32,
16623 #[doc = "Body frame yaw / psi angular speed"]
16624 pub yawspeed: f32,
16625 #[doc = "Latitude"]
16626 pub lat: i32,
16627 #[doc = "Longitude"]
16628 pub lon: i32,
16629 #[doc = "Altitude"]
16630 pub alt: i32,
16631 #[doc = "Ground X Speed (Latitude)"]
16632 pub vx: i16,
16633 #[doc = "Ground Y Speed (Longitude)"]
16634 pub vy: i16,
16635 #[doc = "Ground Z Speed (Altitude)"]
16636 pub vz: i16,
16637 #[doc = "Indicated airspeed"]
16638 pub ind_airspeed: u16,
16639 #[doc = "True airspeed"]
16640 pub true_airspeed: u16,
16641 #[doc = "X acceleration"]
16642 pub xacc: i16,
16643 #[doc = "Y acceleration"]
16644 pub yacc: i16,
16645 #[doc = "Z acceleration"]
16646 pub zacc: i16,
16647}
16648impl HIL_STATE_QUATERNION_DATA {
16649 pub const ENCODED_LEN: usize = 64usize;
16650 pub const DEFAULT: Self = Self {
16651 time_usec: 0_u64,
16652 attitude_quaternion: [0.0_f32; 4usize],
16653 rollspeed: 0.0_f32,
16654 pitchspeed: 0.0_f32,
16655 yawspeed: 0.0_f32,
16656 lat: 0_i32,
16657 lon: 0_i32,
16658 alt: 0_i32,
16659 vx: 0_i16,
16660 vy: 0_i16,
16661 vz: 0_i16,
16662 ind_airspeed: 0_u16,
16663 true_airspeed: 0_u16,
16664 xacc: 0_i16,
16665 yacc: 0_i16,
16666 zacc: 0_i16,
16667 };
16668 #[cfg(feature = "arbitrary")]
16669 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16670 use arbitrary::{Arbitrary, Unstructured};
16671 let mut buf = [0u8; 1024];
16672 rng.fill_bytes(&mut buf);
16673 let mut unstructured = Unstructured::new(&buf);
16674 Self::arbitrary(&mut unstructured).unwrap_or_default()
16675 }
16676}
16677impl Default for HIL_STATE_QUATERNION_DATA {
16678 fn default() -> Self {
16679 Self::DEFAULT.clone()
16680 }
16681}
16682impl MessageData for HIL_STATE_QUATERNION_DATA {
16683 type Message = MavMessage;
16684 const ID: u32 = 115u32;
16685 const NAME: &'static str = "HIL_STATE_QUATERNION";
16686 const EXTRA_CRC: u8 = 4u8;
16687 const ENCODED_LEN: usize = 64usize;
16688 fn deser(
16689 _version: MavlinkVersion,
16690 __input: &[u8],
16691 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16692 let avail_len = __input.len();
16693 let mut payload_buf = [0; Self::ENCODED_LEN];
16694 let mut buf = if avail_len < Self::ENCODED_LEN {
16695 payload_buf[0..avail_len].copy_from_slice(__input);
16696 Bytes::new(&payload_buf)
16697 } else {
16698 Bytes::new(__input)
16699 };
16700 let mut __struct = Self::default();
16701 __struct.time_usec = buf.get_u64_le();
16702 for v in &mut __struct.attitude_quaternion {
16703 let val = buf.get_f32_le();
16704 *v = val;
16705 }
16706 __struct.rollspeed = buf.get_f32_le();
16707 __struct.pitchspeed = buf.get_f32_le();
16708 __struct.yawspeed = buf.get_f32_le();
16709 __struct.lat = buf.get_i32_le();
16710 __struct.lon = buf.get_i32_le();
16711 __struct.alt = buf.get_i32_le();
16712 __struct.vx = buf.get_i16_le();
16713 __struct.vy = buf.get_i16_le();
16714 __struct.vz = buf.get_i16_le();
16715 __struct.ind_airspeed = buf.get_u16_le();
16716 __struct.true_airspeed = buf.get_u16_le();
16717 __struct.xacc = buf.get_i16_le();
16718 __struct.yacc = buf.get_i16_le();
16719 __struct.zacc = buf.get_i16_le();
16720 Ok(__struct)
16721 }
16722 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16723 let mut __tmp = BytesMut::new(bytes);
16724 #[allow(clippy::absurd_extreme_comparisons)]
16725 #[allow(unused_comparisons)]
16726 if __tmp.remaining() < Self::ENCODED_LEN {
16727 panic!(
16728 "buffer is too small (need {} bytes, but got {})",
16729 Self::ENCODED_LEN,
16730 __tmp.remaining(),
16731 )
16732 }
16733 __tmp.put_u64_le(self.time_usec);
16734 for val in &self.attitude_quaternion {
16735 __tmp.put_f32_le(*val);
16736 }
16737 __tmp.put_f32_le(self.rollspeed);
16738 __tmp.put_f32_le(self.pitchspeed);
16739 __tmp.put_f32_le(self.yawspeed);
16740 __tmp.put_i32_le(self.lat);
16741 __tmp.put_i32_le(self.lon);
16742 __tmp.put_i32_le(self.alt);
16743 __tmp.put_i16_le(self.vx);
16744 __tmp.put_i16_le(self.vy);
16745 __tmp.put_i16_le(self.vz);
16746 __tmp.put_u16_le(self.ind_airspeed);
16747 __tmp.put_u16_le(self.true_airspeed);
16748 __tmp.put_i16_le(self.xacc);
16749 __tmp.put_i16_le(self.yacc);
16750 __tmp.put_i16_le(self.zacc);
16751 if matches!(version, MavlinkVersion::V2) {
16752 let len = __tmp.len();
16753 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16754 } else {
16755 __tmp.len()
16756 }
16757 }
16758}
16759#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16760#[doc = ""]
16761#[doc = "ID: 242"]
16762#[derive(Debug, Clone, PartialEq)]
16763#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16764#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16765#[cfg_attr(feature = "ts", derive(TS))]
16766#[cfg_attr(feature = "ts", ts(export))]
16767pub struct HOME_POSITION_DATA {
16768 #[doc = "Latitude (WGS84)"]
16769 pub latitude: i32,
16770 #[doc = "Longitude (WGS84)"]
16771 pub longitude: i32,
16772 #[doc = "Altitude (MSL). Positive for up."]
16773 pub altitude: i32,
16774 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16775 pub x: f32,
16776 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16777 pub y: f32,
16778 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16779 pub z: f32,
16780 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16781 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16782 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16783 pub q: [f32; 4],
16784 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16785 pub approach_x: f32,
16786 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16787 pub approach_y: f32,
16788 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16789 pub approach_z: f32,
16790 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16791 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16792 pub time_usec: u64,
16793}
16794impl HOME_POSITION_DATA {
16795 pub const ENCODED_LEN: usize = 60usize;
16796 pub const DEFAULT: Self = Self {
16797 latitude: 0_i32,
16798 longitude: 0_i32,
16799 altitude: 0_i32,
16800 x: 0.0_f32,
16801 y: 0.0_f32,
16802 z: 0.0_f32,
16803 q: [0.0_f32; 4usize],
16804 approach_x: 0.0_f32,
16805 approach_y: 0.0_f32,
16806 approach_z: 0.0_f32,
16807 time_usec: 0_u64,
16808 };
16809 #[cfg(feature = "arbitrary")]
16810 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16811 use arbitrary::{Arbitrary, Unstructured};
16812 let mut buf = [0u8; 1024];
16813 rng.fill_bytes(&mut buf);
16814 let mut unstructured = Unstructured::new(&buf);
16815 Self::arbitrary(&mut unstructured).unwrap_or_default()
16816 }
16817}
16818impl Default for HOME_POSITION_DATA {
16819 fn default() -> Self {
16820 Self::DEFAULT.clone()
16821 }
16822}
16823impl MessageData for HOME_POSITION_DATA {
16824 type Message = MavMessage;
16825 const ID: u32 = 242u32;
16826 const NAME: &'static str = "HOME_POSITION";
16827 const EXTRA_CRC: u8 = 104u8;
16828 const ENCODED_LEN: usize = 60usize;
16829 fn deser(
16830 _version: MavlinkVersion,
16831 __input: &[u8],
16832 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16833 let avail_len = __input.len();
16834 let mut payload_buf = [0; Self::ENCODED_LEN];
16835 let mut buf = if avail_len < Self::ENCODED_LEN {
16836 payload_buf[0..avail_len].copy_from_slice(__input);
16837 Bytes::new(&payload_buf)
16838 } else {
16839 Bytes::new(__input)
16840 };
16841 let mut __struct = Self::default();
16842 __struct.latitude = buf.get_i32_le();
16843 __struct.longitude = buf.get_i32_le();
16844 __struct.altitude = buf.get_i32_le();
16845 __struct.x = buf.get_f32_le();
16846 __struct.y = buf.get_f32_le();
16847 __struct.z = buf.get_f32_le();
16848 for v in &mut __struct.q {
16849 let val = buf.get_f32_le();
16850 *v = val;
16851 }
16852 __struct.approach_x = buf.get_f32_le();
16853 __struct.approach_y = buf.get_f32_le();
16854 __struct.approach_z = buf.get_f32_le();
16855 __struct.time_usec = buf.get_u64_le();
16856 Ok(__struct)
16857 }
16858 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16859 let mut __tmp = BytesMut::new(bytes);
16860 #[allow(clippy::absurd_extreme_comparisons)]
16861 #[allow(unused_comparisons)]
16862 if __tmp.remaining() < Self::ENCODED_LEN {
16863 panic!(
16864 "buffer is too small (need {} bytes, but got {})",
16865 Self::ENCODED_LEN,
16866 __tmp.remaining(),
16867 )
16868 }
16869 __tmp.put_i32_le(self.latitude);
16870 __tmp.put_i32_le(self.longitude);
16871 __tmp.put_i32_le(self.altitude);
16872 __tmp.put_f32_le(self.x);
16873 __tmp.put_f32_le(self.y);
16874 __tmp.put_f32_le(self.z);
16875 for val in &self.q {
16876 __tmp.put_f32_le(*val);
16877 }
16878 __tmp.put_f32_le(self.approach_x);
16879 __tmp.put_f32_le(self.approach_y);
16880 __tmp.put_f32_le(self.approach_z);
16881 if matches!(version, MavlinkVersion::V2) {
16882 __tmp.put_u64_le(self.time_usec);
16883 let len = __tmp.len();
16884 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16885 } else {
16886 __tmp.len()
16887 }
16888 }
16889}
16890#[doc = "Temperature and humidity from hygrometer."]
16891#[doc = ""]
16892#[doc = "ID: 12920"]
16893#[derive(Debug, Clone, PartialEq)]
16894#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16896#[cfg_attr(feature = "ts", derive(TS))]
16897#[cfg_attr(feature = "ts", ts(export))]
16898pub struct HYGROMETER_SENSOR_DATA {
16899 #[doc = "Temperature"]
16900 pub temperature: i16,
16901 #[doc = "Humidity"]
16902 pub humidity: u16,
16903 #[doc = "Hygrometer ID"]
16904 pub id: u8,
16905}
16906impl HYGROMETER_SENSOR_DATA {
16907 pub const ENCODED_LEN: usize = 5usize;
16908 pub const DEFAULT: Self = Self {
16909 temperature: 0_i16,
16910 humidity: 0_u16,
16911 id: 0_u8,
16912 };
16913 #[cfg(feature = "arbitrary")]
16914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16915 use arbitrary::{Arbitrary, Unstructured};
16916 let mut buf = [0u8; 1024];
16917 rng.fill_bytes(&mut buf);
16918 let mut unstructured = Unstructured::new(&buf);
16919 Self::arbitrary(&mut unstructured).unwrap_or_default()
16920 }
16921}
16922impl Default for HYGROMETER_SENSOR_DATA {
16923 fn default() -> Self {
16924 Self::DEFAULT.clone()
16925 }
16926}
16927impl MessageData for HYGROMETER_SENSOR_DATA {
16928 type Message = MavMessage;
16929 const ID: u32 = 12920u32;
16930 const NAME: &'static str = "HYGROMETER_SENSOR";
16931 const EXTRA_CRC: u8 = 20u8;
16932 const ENCODED_LEN: usize = 5usize;
16933 fn deser(
16934 _version: MavlinkVersion,
16935 __input: &[u8],
16936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16937 let avail_len = __input.len();
16938 let mut payload_buf = [0; Self::ENCODED_LEN];
16939 let mut buf = if avail_len < Self::ENCODED_LEN {
16940 payload_buf[0..avail_len].copy_from_slice(__input);
16941 Bytes::new(&payload_buf)
16942 } else {
16943 Bytes::new(__input)
16944 };
16945 let mut __struct = Self::default();
16946 __struct.temperature = buf.get_i16_le();
16947 __struct.humidity = buf.get_u16_le();
16948 __struct.id = buf.get_u8();
16949 Ok(__struct)
16950 }
16951 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16952 let mut __tmp = BytesMut::new(bytes);
16953 #[allow(clippy::absurd_extreme_comparisons)]
16954 #[allow(unused_comparisons)]
16955 if __tmp.remaining() < Self::ENCODED_LEN {
16956 panic!(
16957 "buffer is too small (need {} bytes, but got {})",
16958 Self::ENCODED_LEN,
16959 __tmp.remaining(),
16960 )
16961 }
16962 __tmp.put_i16_le(self.temperature);
16963 __tmp.put_u16_le(self.humidity);
16964 __tmp.put_u8(self.id);
16965 if matches!(version, MavlinkVersion::V2) {
16966 let len = __tmp.len();
16967 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16968 } else {
16969 __tmp.len()
16970 }
16971 }
16972}
16973#[doc = "Illuminator status."]
16974#[doc = ""]
16975#[doc = "ID: 440"]
16976#[derive(Debug, Clone, PartialEq)]
16977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16979#[cfg_attr(feature = "ts", derive(TS))]
16980#[cfg_attr(feature = "ts", ts(export))]
16981pub struct ILLUMINATOR_STATUS_DATA {
16982 #[doc = "Time since the start-up of the illuminator in ms"]
16983 pub uptime_ms: u32,
16984 #[doc = "Errors"]
16985 pub error_status: IlluminatorErrorFlags,
16986 #[doc = "Illuminator brightness"]
16987 pub brightness: f32,
16988 #[doc = "Illuminator strobing period in seconds"]
16989 pub strobe_period: f32,
16990 #[doc = "Illuminator strobing duty cycle"]
16991 pub strobe_duty_cycle: f32,
16992 #[doc = "Temperature in Celsius"]
16993 pub temp_c: f32,
16994 #[doc = "Minimum strobing period in seconds"]
16995 pub min_strobe_period: f32,
16996 #[doc = "Maximum strobing period in seconds"]
16997 pub max_strobe_period: f32,
16998 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16999 pub enable: u8,
17000 #[doc = "Supported illuminator modes"]
17001 pub mode_bitmask: IlluminatorMode,
17002 #[doc = "Illuminator mode"]
17003 pub mode: IlluminatorMode,
17004}
17005impl ILLUMINATOR_STATUS_DATA {
17006 pub const ENCODED_LEN: usize = 35usize;
17007 pub const DEFAULT: Self = Self {
17008 uptime_ms: 0_u32,
17009 error_status: IlluminatorErrorFlags::DEFAULT,
17010 brightness: 0.0_f32,
17011 strobe_period: 0.0_f32,
17012 strobe_duty_cycle: 0.0_f32,
17013 temp_c: 0.0_f32,
17014 min_strobe_period: 0.0_f32,
17015 max_strobe_period: 0.0_f32,
17016 enable: 0_u8,
17017 mode_bitmask: IlluminatorMode::DEFAULT,
17018 mode: IlluminatorMode::DEFAULT,
17019 };
17020 #[cfg(feature = "arbitrary")]
17021 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17022 use arbitrary::{Arbitrary, Unstructured};
17023 let mut buf = [0u8; 1024];
17024 rng.fill_bytes(&mut buf);
17025 let mut unstructured = Unstructured::new(&buf);
17026 Self::arbitrary(&mut unstructured).unwrap_or_default()
17027 }
17028}
17029impl Default for ILLUMINATOR_STATUS_DATA {
17030 fn default() -> Self {
17031 Self::DEFAULT.clone()
17032 }
17033}
17034impl MessageData for ILLUMINATOR_STATUS_DATA {
17035 type Message = MavMessage;
17036 const ID: u32 = 440u32;
17037 const NAME: &'static str = "ILLUMINATOR_STATUS";
17038 const EXTRA_CRC: u8 = 66u8;
17039 const ENCODED_LEN: usize = 35usize;
17040 fn deser(
17041 _version: MavlinkVersion,
17042 __input: &[u8],
17043 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17044 let avail_len = __input.len();
17045 let mut payload_buf = [0; Self::ENCODED_LEN];
17046 let mut buf = if avail_len < Self::ENCODED_LEN {
17047 payload_buf[0..avail_len].copy_from_slice(__input);
17048 Bytes::new(&payload_buf)
17049 } else {
17050 Bytes::new(__input)
17051 };
17052 let mut __struct = Self::default();
17053 __struct.uptime_ms = buf.get_u32_le();
17054 let tmp = buf.get_u32_le();
17055 __struct.error_status = IlluminatorErrorFlags::from_bits(
17056 tmp & IlluminatorErrorFlags::all().bits(),
17057 )
17058 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17059 flag_type: "IlluminatorErrorFlags",
17060 value: tmp as u32,
17061 })?;
17062 __struct.brightness = buf.get_f32_le();
17063 __struct.strobe_period = buf.get_f32_le();
17064 __struct.strobe_duty_cycle = buf.get_f32_le();
17065 __struct.temp_c = buf.get_f32_le();
17066 __struct.min_strobe_period = buf.get_f32_le();
17067 __struct.max_strobe_period = buf.get_f32_le();
17068 __struct.enable = buf.get_u8();
17069 let tmp = buf.get_u8();
17070 __struct.mode_bitmask =
17071 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17072 enum_type: "IlluminatorMode",
17073 value: tmp as u32,
17074 })?;
17075 let tmp = buf.get_u8();
17076 __struct.mode =
17077 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17078 enum_type: "IlluminatorMode",
17079 value: tmp as u32,
17080 })?;
17081 Ok(__struct)
17082 }
17083 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17084 let mut __tmp = BytesMut::new(bytes);
17085 #[allow(clippy::absurd_extreme_comparisons)]
17086 #[allow(unused_comparisons)]
17087 if __tmp.remaining() < Self::ENCODED_LEN {
17088 panic!(
17089 "buffer is too small (need {} bytes, but got {})",
17090 Self::ENCODED_LEN,
17091 __tmp.remaining(),
17092 )
17093 }
17094 __tmp.put_u32_le(self.uptime_ms);
17095 __tmp.put_u32_le(self.error_status.bits());
17096 __tmp.put_f32_le(self.brightness);
17097 __tmp.put_f32_le(self.strobe_period);
17098 __tmp.put_f32_le(self.strobe_duty_cycle);
17099 __tmp.put_f32_le(self.temp_c);
17100 __tmp.put_f32_le(self.min_strobe_period);
17101 __tmp.put_f32_le(self.max_strobe_period);
17102 __tmp.put_u8(self.enable);
17103 __tmp.put_u8(self.mode_bitmask as u8);
17104 __tmp.put_u8(self.mode as u8);
17105 if matches!(version, MavlinkVersion::V2) {
17106 let len = __tmp.len();
17107 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17108 } else {
17109 __tmp.len()
17110 }
17111 }
17112}
17113#[doc = "Status of the Iridium SBD link."]
17114#[doc = ""]
17115#[doc = "ID: 335"]
17116#[derive(Debug, Clone, PartialEq)]
17117#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17119#[cfg_attr(feature = "ts", derive(TS))]
17120#[cfg_attr(feature = "ts", ts(export))]
17121pub struct ISBD_LINK_STATUS_DATA {
17122 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17123 pub timestamp: u64,
17124 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17125 pub last_heartbeat: u64,
17126 #[doc = "Number of failed SBD sessions."]
17127 pub failed_sessions: u16,
17128 #[doc = "Number of successful SBD sessions."]
17129 pub successful_sessions: u16,
17130 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17131 pub signal_quality: u8,
17132 #[doc = "1: Ring call pending, 0: No call pending."]
17133 pub ring_pending: u8,
17134 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17135 pub tx_session_pending: u8,
17136 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17137 pub rx_session_pending: u8,
17138}
17139impl ISBD_LINK_STATUS_DATA {
17140 pub const ENCODED_LEN: usize = 24usize;
17141 pub const DEFAULT: Self = Self {
17142 timestamp: 0_u64,
17143 last_heartbeat: 0_u64,
17144 failed_sessions: 0_u16,
17145 successful_sessions: 0_u16,
17146 signal_quality: 0_u8,
17147 ring_pending: 0_u8,
17148 tx_session_pending: 0_u8,
17149 rx_session_pending: 0_u8,
17150 };
17151 #[cfg(feature = "arbitrary")]
17152 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17153 use arbitrary::{Arbitrary, Unstructured};
17154 let mut buf = [0u8; 1024];
17155 rng.fill_bytes(&mut buf);
17156 let mut unstructured = Unstructured::new(&buf);
17157 Self::arbitrary(&mut unstructured).unwrap_or_default()
17158 }
17159}
17160impl Default for ISBD_LINK_STATUS_DATA {
17161 fn default() -> Self {
17162 Self::DEFAULT.clone()
17163 }
17164}
17165impl MessageData for ISBD_LINK_STATUS_DATA {
17166 type Message = MavMessage;
17167 const ID: u32 = 335u32;
17168 const NAME: &'static str = "ISBD_LINK_STATUS";
17169 const EXTRA_CRC: u8 = 225u8;
17170 const ENCODED_LEN: usize = 24usize;
17171 fn deser(
17172 _version: MavlinkVersion,
17173 __input: &[u8],
17174 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17175 let avail_len = __input.len();
17176 let mut payload_buf = [0; Self::ENCODED_LEN];
17177 let mut buf = if avail_len < Self::ENCODED_LEN {
17178 payload_buf[0..avail_len].copy_from_slice(__input);
17179 Bytes::new(&payload_buf)
17180 } else {
17181 Bytes::new(__input)
17182 };
17183 let mut __struct = Self::default();
17184 __struct.timestamp = buf.get_u64_le();
17185 __struct.last_heartbeat = buf.get_u64_le();
17186 __struct.failed_sessions = buf.get_u16_le();
17187 __struct.successful_sessions = buf.get_u16_le();
17188 __struct.signal_quality = buf.get_u8();
17189 __struct.ring_pending = buf.get_u8();
17190 __struct.tx_session_pending = buf.get_u8();
17191 __struct.rx_session_pending = buf.get_u8();
17192 Ok(__struct)
17193 }
17194 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17195 let mut __tmp = BytesMut::new(bytes);
17196 #[allow(clippy::absurd_extreme_comparisons)]
17197 #[allow(unused_comparisons)]
17198 if __tmp.remaining() < Self::ENCODED_LEN {
17199 panic!(
17200 "buffer is too small (need {} bytes, but got {})",
17201 Self::ENCODED_LEN,
17202 __tmp.remaining(),
17203 )
17204 }
17205 __tmp.put_u64_le(self.timestamp);
17206 __tmp.put_u64_le(self.last_heartbeat);
17207 __tmp.put_u16_le(self.failed_sessions);
17208 __tmp.put_u16_le(self.successful_sessions);
17209 __tmp.put_u8(self.signal_quality);
17210 __tmp.put_u8(self.ring_pending);
17211 __tmp.put_u8(self.tx_session_pending);
17212 __tmp.put_u8(self.rx_session_pending);
17213 if matches!(version, MavlinkVersion::V2) {
17214 let len = __tmp.len();
17215 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17216 } else {
17217 __tmp.len()
17218 }
17219 }
17220}
17221#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17222#[doc = ""]
17223#[doc = "ID: 149"]
17224#[derive(Debug, Clone, PartialEq)]
17225#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17226#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17227#[cfg_attr(feature = "ts", derive(TS))]
17228#[cfg_attr(feature = "ts", ts(export))]
17229pub struct LANDING_TARGET_DATA {
17230 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17231 pub time_usec: u64,
17232 #[doc = "X-axis angular offset of the target from the center of the image"]
17233 pub angle_x: f32,
17234 #[doc = "Y-axis angular offset of the target from the center of the image"]
17235 pub angle_y: f32,
17236 #[doc = "Distance to the target from the vehicle"]
17237 pub distance: f32,
17238 #[doc = "Size of target along x-axis"]
17239 pub size_x: f32,
17240 #[doc = "Size of target along y-axis"]
17241 pub size_y: f32,
17242 #[doc = "The ID of the target if multiple targets are present"]
17243 pub target_num: u8,
17244 #[doc = "Coordinate frame used for following fields."]
17245 pub frame: MavFrame,
17246 #[doc = "X Position of the landing target in MAV_FRAME"]
17247 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17248 pub x: f32,
17249 #[doc = "Y Position of the landing target in MAV_FRAME"]
17250 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17251 pub y: f32,
17252 #[doc = "Z Position of the landing target in MAV_FRAME"]
17253 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17254 pub z: f32,
17255 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17256 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17257 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17258 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17259 pub q: [f32; 4],
17260 #[doc = "Type of landing target"]
17261 #[cfg_attr(feature = "serde", serde(default))]
17262 pub mavtype: LandingTargetType,
17263 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17264 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17265 pub position_valid: u8,
17266}
17267impl LANDING_TARGET_DATA {
17268 pub const ENCODED_LEN: usize = 60usize;
17269 pub const DEFAULT: Self = Self {
17270 time_usec: 0_u64,
17271 angle_x: 0.0_f32,
17272 angle_y: 0.0_f32,
17273 distance: 0.0_f32,
17274 size_x: 0.0_f32,
17275 size_y: 0.0_f32,
17276 target_num: 0_u8,
17277 frame: MavFrame::DEFAULT,
17278 x: 0.0_f32,
17279 y: 0.0_f32,
17280 z: 0.0_f32,
17281 q: [0.0_f32; 4usize],
17282 mavtype: LandingTargetType::DEFAULT,
17283 position_valid: 0_u8,
17284 };
17285 #[cfg(feature = "arbitrary")]
17286 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17287 use arbitrary::{Arbitrary, Unstructured};
17288 let mut buf = [0u8; 1024];
17289 rng.fill_bytes(&mut buf);
17290 let mut unstructured = Unstructured::new(&buf);
17291 Self::arbitrary(&mut unstructured).unwrap_or_default()
17292 }
17293}
17294impl Default for LANDING_TARGET_DATA {
17295 fn default() -> Self {
17296 Self::DEFAULT.clone()
17297 }
17298}
17299impl MessageData for LANDING_TARGET_DATA {
17300 type Message = MavMessage;
17301 const ID: u32 = 149u32;
17302 const NAME: &'static str = "LANDING_TARGET";
17303 const EXTRA_CRC: u8 = 200u8;
17304 const ENCODED_LEN: usize = 60usize;
17305 fn deser(
17306 _version: MavlinkVersion,
17307 __input: &[u8],
17308 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17309 let avail_len = __input.len();
17310 let mut payload_buf = [0; Self::ENCODED_LEN];
17311 let mut buf = if avail_len < Self::ENCODED_LEN {
17312 payload_buf[0..avail_len].copy_from_slice(__input);
17313 Bytes::new(&payload_buf)
17314 } else {
17315 Bytes::new(__input)
17316 };
17317 let mut __struct = Self::default();
17318 __struct.time_usec = buf.get_u64_le();
17319 __struct.angle_x = buf.get_f32_le();
17320 __struct.angle_y = buf.get_f32_le();
17321 __struct.distance = buf.get_f32_le();
17322 __struct.size_x = buf.get_f32_le();
17323 __struct.size_y = buf.get_f32_le();
17324 __struct.target_num = buf.get_u8();
17325 let tmp = buf.get_u8();
17326 __struct.frame =
17327 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17328 enum_type: "MavFrame",
17329 value: tmp as u32,
17330 })?;
17331 __struct.x = buf.get_f32_le();
17332 __struct.y = buf.get_f32_le();
17333 __struct.z = buf.get_f32_le();
17334 for v in &mut __struct.q {
17335 let val = buf.get_f32_le();
17336 *v = val;
17337 }
17338 let tmp = buf.get_u8();
17339 __struct.mavtype =
17340 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17341 enum_type: "LandingTargetType",
17342 value: tmp as u32,
17343 })?;
17344 __struct.position_valid = buf.get_u8();
17345 Ok(__struct)
17346 }
17347 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17348 let mut __tmp = BytesMut::new(bytes);
17349 #[allow(clippy::absurd_extreme_comparisons)]
17350 #[allow(unused_comparisons)]
17351 if __tmp.remaining() < Self::ENCODED_LEN {
17352 panic!(
17353 "buffer is too small (need {} bytes, but got {})",
17354 Self::ENCODED_LEN,
17355 __tmp.remaining(),
17356 )
17357 }
17358 __tmp.put_u64_le(self.time_usec);
17359 __tmp.put_f32_le(self.angle_x);
17360 __tmp.put_f32_le(self.angle_y);
17361 __tmp.put_f32_le(self.distance);
17362 __tmp.put_f32_le(self.size_x);
17363 __tmp.put_f32_le(self.size_y);
17364 __tmp.put_u8(self.target_num);
17365 __tmp.put_u8(self.frame as u8);
17366 if matches!(version, MavlinkVersion::V2) {
17367 __tmp.put_f32_le(self.x);
17368 __tmp.put_f32_le(self.y);
17369 __tmp.put_f32_le(self.z);
17370 for val in &self.q {
17371 __tmp.put_f32_le(*val);
17372 }
17373 __tmp.put_u8(self.mavtype as u8);
17374 __tmp.put_u8(self.position_valid);
17375 let len = __tmp.len();
17376 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17377 } else {
17378 __tmp.len()
17379 }
17380 }
17381}
17382#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17383#[doc = ""]
17384#[doc = "ID: 8"]
17385#[derive(Debug, Clone, PartialEq)]
17386#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17388#[cfg_attr(feature = "ts", derive(TS))]
17389#[cfg_attr(feature = "ts", ts(export))]
17390pub struct LINK_NODE_STATUS_DATA {
17391 #[doc = "Timestamp (time since system boot)."]
17392 pub timestamp: u64,
17393 #[doc = "Transmit rate"]
17394 pub tx_rate: u32,
17395 #[doc = "Receive rate"]
17396 pub rx_rate: u32,
17397 #[doc = "Messages sent"]
17398 pub messages_sent: u32,
17399 #[doc = "Messages received (estimated from counting seq)"]
17400 pub messages_received: u32,
17401 #[doc = "Messages lost (estimated from counting seq)"]
17402 pub messages_lost: u32,
17403 #[doc = "Number of bytes that could not be parsed correctly."]
17404 pub rx_parse_err: u16,
17405 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17406 pub tx_overflows: u16,
17407 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17408 pub rx_overflows: u16,
17409 #[doc = "Remaining free transmit buffer space"]
17410 pub tx_buf: u8,
17411 #[doc = "Remaining free receive buffer space"]
17412 pub rx_buf: u8,
17413}
17414impl LINK_NODE_STATUS_DATA {
17415 pub const ENCODED_LEN: usize = 36usize;
17416 pub const DEFAULT: Self = Self {
17417 timestamp: 0_u64,
17418 tx_rate: 0_u32,
17419 rx_rate: 0_u32,
17420 messages_sent: 0_u32,
17421 messages_received: 0_u32,
17422 messages_lost: 0_u32,
17423 rx_parse_err: 0_u16,
17424 tx_overflows: 0_u16,
17425 rx_overflows: 0_u16,
17426 tx_buf: 0_u8,
17427 rx_buf: 0_u8,
17428 };
17429 #[cfg(feature = "arbitrary")]
17430 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17431 use arbitrary::{Arbitrary, Unstructured};
17432 let mut buf = [0u8; 1024];
17433 rng.fill_bytes(&mut buf);
17434 let mut unstructured = Unstructured::new(&buf);
17435 Self::arbitrary(&mut unstructured).unwrap_or_default()
17436 }
17437}
17438impl Default for LINK_NODE_STATUS_DATA {
17439 fn default() -> Self {
17440 Self::DEFAULT.clone()
17441 }
17442}
17443impl MessageData for LINK_NODE_STATUS_DATA {
17444 type Message = MavMessage;
17445 const ID: u32 = 8u32;
17446 const NAME: &'static str = "LINK_NODE_STATUS";
17447 const EXTRA_CRC: u8 = 117u8;
17448 const ENCODED_LEN: usize = 36usize;
17449 fn deser(
17450 _version: MavlinkVersion,
17451 __input: &[u8],
17452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17453 let avail_len = __input.len();
17454 let mut payload_buf = [0; Self::ENCODED_LEN];
17455 let mut buf = if avail_len < Self::ENCODED_LEN {
17456 payload_buf[0..avail_len].copy_from_slice(__input);
17457 Bytes::new(&payload_buf)
17458 } else {
17459 Bytes::new(__input)
17460 };
17461 let mut __struct = Self::default();
17462 __struct.timestamp = buf.get_u64_le();
17463 __struct.tx_rate = buf.get_u32_le();
17464 __struct.rx_rate = buf.get_u32_le();
17465 __struct.messages_sent = buf.get_u32_le();
17466 __struct.messages_received = buf.get_u32_le();
17467 __struct.messages_lost = buf.get_u32_le();
17468 __struct.rx_parse_err = buf.get_u16_le();
17469 __struct.tx_overflows = buf.get_u16_le();
17470 __struct.rx_overflows = buf.get_u16_le();
17471 __struct.tx_buf = buf.get_u8();
17472 __struct.rx_buf = buf.get_u8();
17473 Ok(__struct)
17474 }
17475 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17476 let mut __tmp = BytesMut::new(bytes);
17477 #[allow(clippy::absurd_extreme_comparisons)]
17478 #[allow(unused_comparisons)]
17479 if __tmp.remaining() < Self::ENCODED_LEN {
17480 panic!(
17481 "buffer is too small (need {} bytes, but got {})",
17482 Self::ENCODED_LEN,
17483 __tmp.remaining(),
17484 )
17485 }
17486 __tmp.put_u64_le(self.timestamp);
17487 __tmp.put_u32_le(self.tx_rate);
17488 __tmp.put_u32_le(self.rx_rate);
17489 __tmp.put_u32_le(self.messages_sent);
17490 __tmp.put_u32_le(self.messages_received);
17491 __tmp.put_u32_le(self.messages_lost);
17492 __tmp.put_u16_le(self.rx_parse_err);
17493 __tmp.put_u16_le(self.tx_overflows);
17494 __tmp.put_u16_le(self.rx_overflows);
17495 __tmp.put_u8(self.tx_buf);
17496 __tmp.put_u8(self.rx_buf);
17497 if matches!(version, MavlinkVersion::V2) {
17498 let len = __tmp.len();
17499 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17500 } else {
17501 __tmp.len()
17502 }
17503 }
17504}
17505#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17506#[doc = ""]
17507#[doc = "ID: 32"]
17508#[derive(Debug, Clone, PartialEq)]
17509#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17510#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17511#[cfg_attr(feature = "ts", derive(TS))]
17512#[cfg_attr(feature = "ts", ts(export))]
17513pub struct LOCAL_POSITION_NED_DATA {
17514 #[doc = "Timestamp (time since system boot)."]
17515 pub time_boot_ms: u32,
17516 #[doc = "X Position"]
17517 pub x: f32,
17518 #[doc = "Y Position"]
17519 pub y: f32,
17520 #[doc = "Z Position"]
17521 pub z: f32,
17522 #[doc = "X Speed"]
17523 pub vx: f32,
17524 #[doc = "Y Speed"]
17525 pub vy: f32,
17526 #[doc = "Z Speed"]
17527 pub vz: f32,
17528}
17529impl LOCAL_POSITION_NED_DATA {
17530 pub const ENCODED_LEN: usize = 28usize;
17531 pub const DEFAULT: Self = Self {
17532 time_boot_ms: 0_u32,
17533 x: 0.0_f32,
17534 y: 0.0_f32,
17535 z: 0.0_f32,
17536 vx: 0.0_f32,
17537 vy: 0.0_f32,
17538 vz: 0.0_f32,
17539 };
17540 #[cfg(feature = "arbitrary")]
17541 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17542 use arbitrary::{Arbitrary, Unstructured};
17543 let mut buf = [0u8; 1024];
17544 rng.fill_bytes(&mut buf);
17545 let mut unstructured = Unstructured::new(&buf);
17546 Self::arbitrary(&mut unstructured).unwrap_or_default()
17547 }
17548}
17549impl Default for LOCAL_POSITION_NED_DATA {
17550 fn default() -> Self {
17551 Self::DEFAULT.clone()
17552 }
17553}
17554impl MessageData for LOCAL_POSITION_NED_DATA {
17555 type Message = MavMessage;
17556 const ID: u32 = 32u32;
17557 const NAME: &'static str = "LOCAL_POSITION_NED";
17558 const EXTRA_CRC: u8 = 185u8;
17559 const ENCODED_LEN: usize = 28usize;
17560 fn deser(
17561 _version: MavlinkVersion,
17562 __input: &[u8],
17563 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17564 let avail_len = __input.len();
17565 let mut payload_buf = [0; Self::ENCODED_LEN];
17566 let mut buf = if avail_len < Self::ENCODED_LEN {
17567 payload_buf[0..avail_len].copy_from_slice(__input);
17568 Bytes::new(&payload_buf)
17569 } else {
17570 Bytes::new(__input)
17571 };
17572 let mut __struct = Self::default();
17573 __struct.time_boot_ms = buf.get_u32_le();
17574 __struct.x = buf.get_f32_le();
17575 __struct.y = buf.get_f32_le();
17576 __struct.z = buf.get_f32_le();
17577 __struct.vx = buf.get_f32_le();
17578 __struct.vy = buf.get_f32_le();
17579 __struct.vz = buf.get_f32_le();
17580 Ok(__struct)
17581 }
17582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17583 let mut __tmp = BytesMut::new(bytes);
17584 #[allow(clippy::absurd_extreme_comparisons)]
17585 #[allow(unused_comparisons)]
17586 if __tmp.remaining() < Self::ENCODED_LEN {
17587 panic!(
17588 "buffer is too small (need {} bytes, but got {})",
17589 Self::ENCODED_LEN,
17590 __tmp.remaining(),
17591 )
17592 }
17593 __tmp.put_u32_le(self.time_boot_ms);
17594 __tmp.put_f32_le(self.x);
17595 __tmp.put_f32_le(self.y);
17596 __tmp.put_f32_le(self.z);
17597 __tmp.put_f32_le(self.vx);
17598 __tmp.put_f32_le(self.vy);
17599 __tmp.put_f32_le(self.vz);
17600 if matches!(version, MavlinkVersion::V2) {
17601 let len = __tmp.len();
17602 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17603 } else {
17604 __tmp.len()
17605 }
17606 }
17607}
17608#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17609#[doc = ""]
17610#[doc = "ID: 64"]
17611#[derive(Debug, Clone, PartialEq)]
17612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17614#[cfg_attr(feature = "ts", derive(TS))]
17615#[cfg_attr(feature = "ts", ts(export))]
17616pub struct LOCAL_POSITION_NED_COV_DATA {
17617 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17618 pub time_usec: u64,
17619 #[doc = "X Position"]
17620 pub x: f32,
17621 #[doc = "Y Position"]
17622 pub y: f32,
17623 #[doc = "Z Position"]
17624 pub z: f32,
17625 #[doc = "X Speed"]
17626 pub vx: f32,
17627 #[doc = "Y Speed"]
17628 pub vy: f32,
17629 #[doc = "Z Speed"]
17630 pub vz: f32,
17631 #[doc = "X Acceleration"]
17632 pub ax: f32,
17633 #[doc = "Y Acceleration"]
17634 pub ay: f32,
17635 #[doc = "Z Acceleration"]
17636 pub az: f32,
17637 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17638 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17639 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17640 pub covariance: [f32; 45],
17641 #[doc = "Class id of the estimator this estimate originated from."]
17642 pub estimator_type: MavEstimatorType,
17643}
17644impl LOCAL_POSITION_NED_COV_DATA {
17645 pub const ENCODED_LEN: usize = 225usize;
17646 pub const DEFAULT: Self = Self {
17647 time_usec: 0_u64,
17648 x: 0.0_f32,
17649 y: 0.0_f32,
17650 z: 0.0_f32,
17651 vx: 0.0_f32,
17652 vy: 0.0_f32,
17653 vz: 0.0_f32,
17654 ax: 0.0_f32,
17655 ay: 0.0_f32,
17656 az: 0.0_f32,
17657 covariance: [0.0_f32; 45usize],
17658 estimator_type: MavEstimatorType::DEFAULT,
17659 };
17660 #[cfg(feature = "arbitrary")]
17661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17662 use arbitrary::{Arbitrary, Unstructured};
17663 let mut buf = [0u8; 1024];
17664 rng.fill_bytes(&mut buf);
17665 let mut unstructured = Unstructured::new(&buf);
17666 Self::arbitrary(&mut unstructured).unwrap_or_default()
17667 }
17668}
17669impl Default for LOCAL_POSITION_NED_COV_DATA {
17670 fn default() -> Self {
17671 Self::DEFAULT.clone()
17672 }
17673}
17674impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17675 type Message = MavMessage;
17676 const ID: u32 = 64u32;
17677 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17678 const EXTRA_CRC: u8 = 191u8;
17679 const ENCODED_LEN: usize = 225usize;
17680 fn deser(
17681 _version: MavlinkVersion,
17682 __input: &[u8],
17683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17684 let avail_len = __input.len();
17685 let mut payload_buf = [0; Self::ENCODED_LEN];
17686 let mut buf = if avail_len < Self::ENCODED_LEN {
17687 payload_buf[0..avail_len].copy_from_slice(__input);
17688 Bytes::new(&payload_buf)
17689 } else {
17690 Bytes::new(__input)
17691 };
17692 let mut __struct = Self::default();
17693 __struct.time_usec = buf.get_u64_le();
17694 __struct.x = buf.get_f32_le();
17695 __struct.y = buf.get_f32_le();
17696 __struct.z = buf.get_f32_le();
17697 __struct.vx = buf.get_f32_le();
17698 __struct.vy = buf.get_f32_le();
17699 __struct.vz = buf.get_f32_le();
17700 __struct.ax = buf.get_f32_le();
17701 __struct.ay = buf.get_f32_le();
17702 __struct.az = buf.get_f32_le();
17703 for v in &mut __struct.covariance {
17704 let val = buf.get_f32_le();
17705 *v = val;
17706 }
17707 let tmp = buf.get_u8();
17708 __struct.estimator_type =
17709 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17710 enum_type: "MavEstimatorType",
17711 value: tmp as u32,
17712 })?;
17713 Ok(__struct)
17714 }
17715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17716 let mut __tmp = BytesMut::new(bytes);
17717 #[allow(clippy::absurd_extreme_comparisons)]
17718 #[allow(unused_comparisons)]
17719 if __tmp.remaining() < Self::ENCODED_LEN {
17720 panic!(
17721 "buffer is too small (need {} bytes, but got {})",
17722 Self::ENCODED_LEN,
17723 __tmp.remaining(),
17724 )
17725 }
17726 __tmp.put_u64_le(self.time_usec);
17727 __tmp.put_f32_le(self.x);
17728 __tmp.put_f32_le(self.y);
17729 __tmp.put_f32_le(self.z);
17730 __tmp.put_f32_le(self.vx);
17731 __tmp.put_f32_le(self.vy);
17732 __tmp.put_f32_le(self.vz);
17733 __tmp.put_f32_le(self.ax);
17734 __tmp.put_f32_le(self.ay);
17735 __tmp.put_f32_le(self.az);
17736 for val in &self.covariance {
17737 __tmp.put_f32_le(*val);
17738 }
17739 __tmp.put_u8(self.estimator_type as u8);
17740 if matches!(version, MavlinkVersion::V2) {
17741 let len = __tmp.len();
17742 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17743 } else {
17744 __tmp.len()
17745 }
17746 }
17747}
17748#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17749#[doc = ""]
17750#[doc = "ID: 89"]
17751#[derive(Debug, Clone, PartialEq)]
17752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17753#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17754#[cfg_attr(feature = "ts", derive(TS))]
17755#[cfg_attr(feature = "ts", ts(export))]
17756pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17757 #[doc = "Timestamp (time since system boot)."]
17758 pub time_boot_ms: u32,
17759 #[doc = "X Position"]
17760 pub x: f32,
17761 #[doc = "Y Position"]
17762 pub y: f32,
17763 #[doc = "Z Position"]
17764 pub z: f32,
17765 #[doc = "Roll"]
17766 pub roll: f32,
17767 #[doc = "Pitch"]
17768 pub pitch: f32,
17769 #[doc = "Yaw"]
17770 pub yaw: f32,
17771}
17772impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17773 pub const ENCODED_LEN: usize = 28usize;
17774 pub const DEFAULT: Self = Self {
17775 time_boot_ms: 0_u32,
17776 x: 0.0_f32,
17777 y: 0.0_f32,
17778 z: 0.0_f32,
17779 roll: 0.0_f32,
17780 pitch: 0.0_f32,
17781 yaw: 0.0_f32,
17782 };
17783 #[cfg(feature = "arbitrary")]
17784 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17785 use arbitrary::{Arbitrary, Unstructured};
17786 let mut buf = [0u8; 1024];
17787 rng.fill_bytes(&mut buf);
17788 let mut unstructured = Unstructured::new(&buf);
17789 Self::arbitrary(&mut unstructured).unwrap_or_default()
17790 }
17791}
17792impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17793 fn default() -> Self {
17794 Self::DEFAULT.clone()
17795 }
17796}
17797impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17798 type Message = MavMessage;
17799 const ID: u32 = 89u32;
17800 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17801 const EXTRA_CRC: u8 = 231u8;
17802 const ENCODED_LEN: usize = 28usize;
17803 fn deser(
17804 _version: MavlinkVersion,
17805 __input: &[u8],
17806 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17807 let avail_len = __input.len();
17808 let mut payload_buf = [0; Self::ENCODED_LEN];
17809 let mut buf = if avail_len < Self::ENCODED_LEN {
17810 payload_buf[0..avail_len].copy_from_slice(__input);
17811 Bytes::new(&payload_buf)
17812 } else {
17813 Bytes::new(__input)
17814 };
17815 let mut __struct = Self::default();
17816 __struct.time_boot_ms = buf.get_u32_le();
17817 __struct.x = buf.get_f32_le();
17818 __struct.y = buf.get_f32_le();
17819 __struct.z = buf.get_f32_le();
17820 __struct.roll = buf.get_f32_le();
17821 __struct.pitch = buf.get_f32_le();
17822 __struct.yaw = buf.get_f32_le();
17823 Ok(__struct)
17824 }
17825 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17826 let mut __tmp = BytesMut::new(bytes);
17827 #[allow(clippy::absurd_extreme_comparisons)]
17828 #[allow(unused_comparisons)]
17829 if __tmp.remaining() < Self::ENCODED_LEN {
17830 panic!(
17831 "buffer is too small (need {} bytes, but got {})",
17832 Self::ENCODED_LEN,
17833 __tmp.remaining(),
17834 )
17835 }
17836 __tmp.put_u32_le(self.time_boot_ms);
17837 __tmp.put_f32_le(self.x);
17838 __tmp.put_f32_le(self.y);
17839 __tmp.put_f32_le(self.z);
17840 __tmp.put_f32_le(self.roll);
17841 __tmp.put_f32_le(self.pitch);
17842 __tmp.put_f32_le(self.yaw);
17843 if matches!(version, MavlinkVersion::V2) {
17844 let len = __tmp.len();
17845 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17846 } else {
17847 __tmp.len()
17848 }
17849 }
17850}
17851#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17852#[doc = ""]
17853#[doc = "ID: 268"]
17854#[derive(Debug, Clone, PartialEq)]
17855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17856#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17857#[cfg_attr(feature = "ts", derive(TS))]
17858#[cfg_attr(feature = "ts", ts(export))]
17859pub struct LOGGING_ACK_DATA {
17860 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17861 pub sequence: u16,
17862 #[doc = "system ID of the target"]
17863 pub target_system: u8,
17864 #[doc = "component ID of the target"]
17865 pub target_component: u8,
17866}
17867impl LOGGING_ACK_DATA {
17868 pub const ENCODED_LEN: usize = 4usize;
17869 pub const DEFAULT: Self = Self {
17870 sequence: 0_u16,
17871 target_system: 0_u8,
17872 target_component: 0_u8,
17873 };
17874 #[cfg(feature = "arbitrary")]
17875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17876 use arbitrary::{Arbitrary, Unstructured};
17877 let mut buf = [0u8; 1024];
17878 rng.fill_bytes(&mut buf);
17879 let mut unstructured = Unstructured::new(&buf);
17880 Self::arbitrary(&mut unstructured).unwrap_or_default()
17881 }
17882}
17883impl Default for LOGGING_ACK_DATA {
17884 fn default() -> Self {
17885 Self::DEFAULT.clone()
17886 }
17887}
17888impl MessageData for LOGGING_ACK_DATA {
17889 type Message = MavMessage;
17890 const ID: u32 = 268u32;
17891 const NAME: &'static str = "LOGGING_ACK";
17892 const EXTRA_CRC: u8 = 14u8;
17893 const ENCODED_LEN: usize = 4usize;
17894 fn deser(
17895 _version: MavlinkVersion,
17896 __input: &[u8],
17897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17898 let avail_len = __input.len();
17899 let mut payload_buf = [0; Self::ENCODED_LEN];
17900 let mut buf = if avail_len < Self::ENCODED_LEN {
17901 payload_buf[0..avail_len].copy_from_slice(__input);
17902 Bytes::new(&payload_buf)
17903 } else {
17904 Bytes::new(__input)
17905 };
17906 let mut __struct = Self::default();
17907 __struct.sequence = buf.get_u16_le();
17908 __struct.target_system = buf.get_u8();
17909 __struct.target_component = buf.get_u8();
17910 Ok(__struct)
17911 }
17912 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17913 let mut __tmp = BytesMut::new(bytes);
17914 #[allow(clippy::absurd_extreme_comparisons)]
17915 #[allow(unused_comparisons)]
17916 if __tmp.remaining() < Self::ENCODED_LEN {
17917 panic!(
17918 "buffer is too small (need {} bytes, but got {})",
17919 Self::ENCODED_LEN,
17920 __tmp.remaining(),
17921 )
17922 }
17923 __tmp.put_u16_le(self.sequence);
17924 __tmp.put_u8(self.target_system);
17925 __tmp.put_u8(self.target_component);
17926 if matches!(version, MavlinkVersion::V2) {
17927 let len = __tmp.len();
17928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17929 } else {
17930 __tmp.len()
17931 }
17932 }
17933}
17934#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17935#[doc = ""]
17936#[doc = "ID: 266"]
17937#[derive(Debug, Clone, PartialEq)]
17938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17940#[cfg_attr(feature = "ts", derive(TS))]
17941#[cfg_attr(feature = "ts", ts(export))]
17942pub struct LOGGING_DATA_DATA {
17943 #[doc = "sequence number (can wrap)"]
17944 pub sequence: u16,
17945 #[doc = "system ID of the target"]
17946 pub target_system: u8,
17947 #[doc = "component ID of the target"]
17948 pub target_component: u8,
17949 #[doc = "data length"]
17950 pub length: u8,
17951 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17952 pub first_message_offset: u8,
17953 #[doc = "logged data"]
17954 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17955 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17956 pub data: [u8; 249],
17957}
17958impl LOGGING_DATA_DATA {
17959 pub const ENCODED_LEN: usize = 255usize;
17960 pub const DEFAULT: Self = Self {
17961 sequence: 0_u16,
17962 target_system: 0_u8,
17963 target_component: 0_u8,
17964 length: 0_u8,
17965 first_message_offset: 0_u8,
17966 data: [0_u8; 249usize],
17967 };
17968 #[cfg(feature = "arbitrary")]
17969 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17970 use arbitrary::{Arbitrary, Unstructured};
17971 let mut buf = [0u8; 1024];
17972 rng.fill_bytes(&mut buf);
17973 let mut unstructured = Unstructured::new(&buf);
17974 Self::arbitrary(&mut unstructured).unwrap_or_default()
17975 }
17976}
17977impl Default for LOGGING_DATA_DATA {
17978 fn default() -> Self {
17979 Self::DEFAULT.clone()
17980 }
17981}
17982impl MessageData for LOGGING_DATA_DATA {
17983 type Message = MavMessage;
17984 const ID: u32 = 266u32;
17985 const NAME: &'static str = "LOGGING_DATA";
17986 const EXTRA_CRC: u8 = 193u8;
17987 const ENCODED_LEN: usize = 255usize;
17988 fn deser(
17989 _version: MavlinkVersion,
17990 __input: &[u8],
17991 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17992 let avail_len = __input.len();
17993 let mut payload_buf = [0; Self::ENCODED_LEN];
17994 let mut buf = if avail_len < Self::ENCODED_LEN {
17995 payload_buf[0..avail_len].copy_from_slice(__input);
17996 Bytes::new(&payload_buf)
17997 } else {
17998 Bytes::new(__input)
17999 };
18000 let mut __struct = Self::default();
18001 __struct.sequence = buf.get_u16_le();
18002 __struct.target_system = buf.get_u8();
18003 __struct.target_component = buf.get_u8();
18004 __struct.length = buf.get_u8();
18005 __struct.first_message_offset = buf.get_u8();
18006 for v in &mut __struct.data {
18007 let val = buf.get_u8();
18008 *v = val;
18009 }
18010 Ok(__struct)
18011 }
18012 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18013 let mut __tmp = BytesMut::new(bytes);
18014 #[allow(clippy::absurd_extreme_comparisons)]
18015 #[allow(unused_comparisons)]
18016 if __tmp.remaining() < Self::ENCODED_LEN {
18017 panic!(
18018 "buffer is too small (need {} bytes, but got {})",
18019 Self::ENCODED_LEN,
18020 __tmp.remaining(),
18021 )
18022 }
18023 __tmp.put_u16_le(self.sequence);
18024 __tmp.put_u8(self.target_system);
18025 __tmp.put_u8(self.target_component);
18026 __tmp.put_u8(self.length);
18027 __tmp.put_u8(self.first_message_offset);
18028 for val in &self.data {
18029 __tmp.put_u8(*val);
18030 }
18031 if matches!(version, MavlinkVersion::V2) {
18032 let len = __tmp.len();
18033 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18034 } else {
18035 __tmp.len()
18036 }
18037 }
18038}
18039#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18040#[doc = ""]
18041#[doc = "ID: 267"]
18042#[derive(Debug, Clone, PartialEq)]
18043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18045#[cfg_attr(feature = "ts", derive(TS))]
18046#[cfg_attr(feature = "ts", ts(export))]
18047pub struct LOGGING_DATA_ACKED_DATA {
18048 #[doc = "sequence number (can wrap)"]
18049 pub sequence: u16,
18050 #[doc = "system ID of the target"]
18051 pub target_system: u8,
18052 #[doc = "component ID of the target"]
18053 pub target_component: u8,
18054 #[doc = "data length"]
18055 pub length: u8,
18056 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18057 pub first_message_offset: u8,
18058 #[doc = "logged data"]
18059 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18060 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18061 pub data: [u8; 249],
18062}
18063impl LOGGING_DATA_ACKED_DATA {
18064 pub const ENCODED_LEN: usize = 255usize;
18065 pub const DEFAULT: Self = Self {
18066 sequence: 0_u16,
18067 target_system: 0_u8,
18068 target_component: 0_u8,
18069 length: 0_u8,
18070 first_message_offset: 0_u8,
18071 data: [0_u8; 249usize],
18072 };
18073 #[cfg(feature = "arbitrary")]
18074 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18075 use arbitrary::{Arbitrary, Unstructured};
18076 let mut buf = [0u8; 1024];
18077 rng.fill_bytes(&mut buf);
18078 let mut unstructured = Unstructured::new(&buf);
18079 Self::arbitrary(&mut unstructured).unwrap_or_default()
18080 }
18081}
18082impl Default for LOGGING_DATA_ACKED_DATA {
18083 fn default() -> Self {
18084 Self::DEFAULT.clone()
18085 }
18086}
18087impl MessageData for LOGGING_DATA_ACKED_DATA {
18088 type Message = MavMessage;
18089 const ID: u32 = 267u32;
18090 const NAME: &'static str = "LOGGING_DATA_ACKED";
18091 const EXTRA_CRC: u8 = 35u8;
18092 const ENCODED_LEN: usize = 255usize;
18093 fn deser(
18094 _version: MavlinkVersion,
18095 __input: &[u8],
18096 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18097 let avail_len = __input.len();
18098 let mut payload_buf = [0; Self::ENCODED_LEN];
18099 let mut buf = if avail_len < Self::ENCODED_LEN {
18100 payload_buf[0..avail_len].copy_from_slice(__input);
18101 Bytes::new(&payload_buf)
18102 } else {
18103 Bytes::new(__input)
18104 };
18105 let mut __struct = Self::default();
18106 __struct.sequence = buf.get_u16_le();
18107 __struct.target_system = buf.get_u8();
18108 __struct.target_component = buf.get_u8();
18109 __struct.length = buf.get_u8();
18110 __struct.first_message_offset = buf.get_u8();
18111 for v in &mut __struct.data {
18112 let val = buf.get_u8();
18113 *v = val;
18114 }
18115 Ok(__struct)
18116 }
18117 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18118 let mut __tmp = BytesMut::new(bytes);
18119 #[allow(clippy::absurd_extreme_comparisons)]
18120 #[allow(unused_comparisons)]
18121 if __tmp.remaining() < Self::ENCODED_LEN {
18122 panic!(
18123 "buffer is too small (need {} bytes, but got {})",
18124 Self::ENCODED_LEN,
18125 __tmp.remaining(),
18126 )
18127 }
18128 __tmp.put_u16_le(self.sequence);
18129 __tmp.put_u8(self.target_system);
18130 __tmp.put_u8(self.target_component);
18131 __tmp.put_u8(self.length);
18132 __tmp.put_u8(self.first_message_offset);
18133 for val in &self.data {
18134 __tmp.put_u8(*val);
18135 }
18136 if matches!(version, MavlinkVersion::V2) {
18137 let len = __tmp.len();
18138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18139 } else {
18140 __tmp.len()
18141 }
18142 }
18143}
18144#[doc = "Reply to LOG_REQUEST_DATA."]
18145#[doc = ""]
18146#[doc = "ID: 120"]
18147#[derive(Debug, Clone, PartialEq)]
18148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18150#[cfg_attr(feature = "ts", derive(TS))]
18151#[cfg_attr(feature = "ts", ts(export))]
18152pub struct LOG_DATA_DATA {
18153 #[doc = "Offset into the log"]
18154 pub ofs: u32,
18155 #[doc = "Log id (from LOG_ENTRY reply)"]
18156 pub id: u16,
18157 #[doc = "Number of bytes (zero for end of log)"]
18158 pub count: u8,
18159 #[doc = "log data"]
18160 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18161 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18162 pub data: [u8; 90],
18163}
18164impl LOG_DATA_DATA {
18165 pub const ENCODED_LEN: usize = 97usize;
18166 pub const DEFAULT: Self = Self {
18167 ofs: 0_u32,
18168 id: 0_u16,
18169 count: 0_u8,
18170 data: [0_u8; 90usize],
18171 };
18172 #[cfg(feature = "arbitrary")]
18173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18174 use arbitrary::{Arbitrary, Unstructured};
18175 let mut buf = [0u8; 1024];
18176 rng.fill_bytes(&mut buf);
18177 let mut unstructured = Unstructured::new(&buf);
18178 Self::arbitrary(&mut unstructured).unwrap_or_default()
18179 }
18180}
18181impl Default for LOG_DATA_DATA {
18182 fn default() -> Self {
18183 Self::DEFAULT.clone()
18184 }
18185}
18186impl MessageData for LOG_DATA_DATA {
18187 type Message = MavMessage;
18188 const ID: u32 = 120u32;
18189 const NAME: &'static str = "LOG_DATA";
18190 const EXTRA_CRC: u8 = 134u8;
18191 const ENCODED_LEN: usize = 97usize;
18192 fn deser(
18193 _version: MavlinkVersion,
18194 __input: &[u8],
18195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18196 let avail_len = __input.len();
18197 let mut payload_buf = [0; Self::ENCODED_LEN];
18198 let mut buf = if avail_len < Self::ENCODED_LEN {
18199 payload_buf[0..avail_len].copy_from_slice(__input);
18200 Bytes::new(&payload_buf)
18201 } else {
18202 Bytes::new(__input)
18203 };
18204 let mut __struct = Self::default();
18205 __struct.ofs = buf.get_u32_le();
18206 __struct.id = buf.get_u16_le();
18207 __struct.count = buf.get_u8();
18208 for v in &mut __struct.data {
18209 let val = buf.get_u8();
18210 *v = val;
18211 }
18212 Ok(__struct)
18213 }
18214 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18215 let mut __tmp = BytesMut::new(bytes);
18216 #[allow(clippy::absurd_extreme_comparisons)]
18217 #[allow(unused_comparisons)]
18218 if __tmp.remaining() < Self::ENCODED_LEN {
18219 panic!(
18220 "buffer is too small (need {} bytes, but got {})",
18221 Self::ENCODED_LEN,
18222 __tmp.remaining(),
18223 )
18224 }
18225 __tmp.put_u32_le(self.ofs);
18226 __tmp.put_u16_le(self.id);
18227 __tmp.put_u8(self.count);
18228 for val in &self.data {
18229 __tmp.put_u8(*val);
18230 }
18231 if matches!(version, MavlinkVersion::V2) {
18232 let len = __tmp.len();
18233 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18234 } else {
18235 __tmp.len()
18236 }
18237 }
18238}
18239#[doc = "Reply to LOG_REQUEST_LIST."]
18240#[doc = ""]
18241#[doc = "ID: 118"]
18242#[derive(Debug, Clone, PartialEq)]
18243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18245#[cfg_attr(feature = "ts", derive(TS))]
18246#[cfg_attr(feature = "ts", ts(export))]
18247pub struct LOG_ENTRY_DATA {
18248 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18249 pub time_utc: u32,
18250 #[doc = "Size of the log (may be approximate)"]
18251 pub size: u32,
18252 #[doc = "Log id"]
18253 pub id: u16,
18254 #[doc = "Total number of logs"]
18255 pub num_logs: u16,
18256 #[doc = "High log number"]
18257 pub last_log_num: u16,
18258}
18259impl LOG_ENTRY_DATA {
18260 pub const ENCODED_LEN: usize = 14usize;
18261 pub const DEFAULT: Self = Self {
18262 time_utc: 0_u32,
18263 size: 0_u32,
18264 id: 0_u16,
18265 num_logs: 0_u16,
18266 last_log_num: 0_u16,
18267 };
18268 #[cfg(feature = "arbitrary")]
18269 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18270 use arbitrary::{Arbitrary, Unstructured};
18271 let mut buf = [0u8; 1024];
18272 rng.fill_bytes(&mut buf);
18273 let mut unstructured = Unstructured::new(&buf);
18274 Self::arbitrary(&mut unstructured).unwrap_or_default()
18275 }
18276}
18277impl Default for LOG_ENTRY_DATA {
18278 fn default() -> Self {
18279 Self::DEFAULT.clone()
18280 }
18281}
18282impl MessageData for LOG_ENTRY_DATA {
18283 type Message = MavMessage;
18284 const ID: u32 = 118u32;
18285 const NAME: &'static str = "LOG_ENTRY";
18286 const EXTRA_CRC: u8 = 56u8;
18287 const ENCODED_LEN: usize = 14usize;
18288 fn deser(
18289 _version: MavlinkVersion,
18290 __input: &[u8],
18291 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18292 let avail_len = __input.len();
18293 let mut payload_buf = [0; Self::ENCODED_LEN];
18294 let mut buf = if avail_len < Self::ENCODED_LEN {
18295 payload_buf[0..avail_len].copy_from_slice(__input);
18296 Bytes::new(&payload_buf)
18297 } else {
18298 Bytes::new(__input)
18299 };
18300 let mut __struct = Self::default();
18301 __struct.time_utc = buf.get_u32_le();
18302 __struct.size = buf.get_u32_le();
18303 __struct.id = buf.get_u16_le();
18304 __struct.num_logs = buf.get_u16_le();
18305 __struct.last_log_num = buf.get_u16_le();
18306 Ok(__struct)
18307 }
18308 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18309 let mut __tmp = BytesMut::new(bytes);
18310 #[allow(clippy::absurd_extreme_comparisons)]
18311 #[allow(unused_comparisons)]
18312 if __tmp.remaining() < Self::ENCODED_LEN {
18313 panic!(
18314 "buffer is too small (need {} bytes, but got {})",
18315 Self::ENCODED_LEN,
18316 __tmp.remaining(),
18317 )
18318 }
18319 __tmp.put_u32_le(self.time_utc);
18320 __tmp.put_u32_le(self.size);
18321 __tmp.put_u16_le(self.id);
18322 __tmp.put_u16_le(self.num_logs);
18323 __tmp.put_u16_le(self.last_log_num);
18324 if matches!(version, MavlinkVersion::V2) {
18325 let len = __tmp.len();
18326 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18327 } else {
18328 __tmp.len()
18329 }
18330 }
18331}
18332#[doc = "Erase all logs."]
18333#[doc = ""]
18334#[doc = "ID: 121"]
18335#[derive(Debug, Clone, PartialEq)]
18336#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18337#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18338#[cfg_attr(feature = "ts", derive(TS))]
18339#[cfg_attr(feature = "ts", ts(export))]
18340pub struct LOG_ERASE_DATA {
18341 #[doc = "System ID"]
18342 pub target_system: u8,
18343 #[doc = "Component ID"]
18344 pub target_component: u8,
18345}
18346impl LOG_ERASE_DATA {
18347 pub const ENCODED_LEN: usize = 2usize;
18348 pub const DEFAULT: Self = Self {
18349 target_system: 0_u8,
18350 target_component: 0_u8,
18351 };
18352 #[cfg(feature = "arbitrary")]
18353 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18354 use arbitrary::{Arbitrary, Unstructured};
18355 let mut buf = [0u8; 1024];
18356 rng.fill_bytes(&mut buf);
18357 let mut unstructured = Unstructured::new(&buf);
18358 Self::arbitrary(&mut unstructured).unwrap_or_default()
18359 }
18360}
18361impl Default for LOG_ERASE_DATA {
18362 fn default() -> Self {
18363 Self::DEFAULT.clone()
18364 }
18365}
18366impl MessageData for LOG_ERASE_DATA {
18367 type Message = MavMessage;
18368 const ID: u32 = 121u32;
18369 const NAME: &'static str = "LOG_ERASE";
18370 const EXTRA_CRC: u8 = 237u8;
18371 const ENCODED_LEN: usize = 2usize;
18372 fn deser(
18373 _version: MavlinkVersion,
18374 __input: &[u8],
18375 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18376 let avail_len = __input.len();
18377 let mut payload_buf = [0; Self::ENCODED_LEN];
18378 let mut buf = if avail_len < Self::ENCODED_LEN {
18379 payload_buf[0..avail_len].copy_from_slice(__input);
18380 Bytes::new(&payload_buf)
18381 } else {
18382 Bytes::new(__input)
18383 };
18384 let mut __struct = Self::default();
18385 __struct.target_system = buf.get_u8();
18386 __struct.target_component = buf.get_u8();
18387 Ok(__struct)
18388 }
18389 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18390 let mut __tmp = BytesMut::new(bytes);
18391 #[allow(clippy::absurd_extreme_comparisons)]
18392 #[allow(unused_comparisons)]
18393 if __tmp.remaining() < Self::ENCODED_LEN {
18394 panic!(
18395 "buffer is too small (need {} bytes, but got {})",
18396 Self::ENCODED_LEN,
18397 __tmp.remaining(),
18398 )
18399 }
18400 __tmp.put_u8(self.target_system);
18401 __tmp.put_u8(self.target_component);
18402 if matches!(version, MavlinkVersion::V2) {
18403 let len = __tmp.len();
18404 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18405 } else {
18406 __tmp.len()
18407 }
18408 }
18409}
18410#[doc = "Request a chunk of a log."]
18411#[doc = ""]
18412#[doc = "ID: 119"]
18413#[derive(Debug, Clone, PartialEq)]
18414#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18416#[cfg_attr(feature = "ts", derive(TS))]
18417#[cfg_attr(feature = "ts", ts(export))]
18418pub struct LOG_REQUEST_DATA_DATA {
18419 #[doc = "Offset into the log"]
18420 pub ofs: u32,
18421 #[doc = "Number of bytes"]
18422 pub count: u32,
18423 #[doc = "Log id (from LOG_ENTRY reply)"]
18424 pub id: u16,
18425 #[doc = "System ID"]
18426 pub target_system: u8,
18427 #[doc = "Component ID"]
18428 pub target_component: u8,
18429}
18430impl LOG_REQUEST_DATA_DATA {
18431 pub const ENCODED_LEN: usize = 12usize;
18432 pub const DEFAULT: Self = Self {
18433 ofs: 0_u32,
18434 count: 0_u32,
18435 id: 0_u16,
18436 target_system: 0_u8,
18437 target_component: 0_u8,
18438 };
18439 #[cfg(feature = "arbitrary")]
18440 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18441 use arbitrary::{Arbitrary, Unstructured};
18442 let mut buf = [0u8; 1024];
18443 rng.fill_bytes(&mut buf);
18444 let mut unstructured = Unstructured::new(&buf);
18445 Self::arbitrary(&mut unstructured).unwrap_or_default()
18446 }
18447}
18448impl Default for LOG_REQUEST_DATA_DATA {
18449 fn default() -> Self {
18450 Self::DEFAULT.clone()
18451 }
18452}
18453impl MessageData for LOG_REQUEST_DATA_DATA {
18454 type Message = MavMessage;
18455 const ID: u32 = 119u32;
18456 const NAME: &'static str = "LOG_REQUEST_DATA";
18457 const EXTRA_CRC: u8 = 116u8;
18458 const ENCODED_LEN: usize = 12usize;
18459 fn deser(
18460 _version: MavlinkVersion,
18461 __input: &[u8],
18462 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18463 let avail_len = __input.len();
18464 let mut payload_buf = [0; Self::ENCODED_LEN];
18465 let mut buf = if avail_len < Self::ENCODED_LEN {
18466 payload_buf[0..avail_len].copy_from_slice(__input);
18467 Bytes::new(&payload_buf)
18468 } else {
18469 Bytes::new(__input)
18470 };
18471 let mut __struct = Self::default();
18472 __struct.ofs = buf.get_u32_le();
18473 __struct.count = buf.get_u32_le();
18474 __struct.id = buf.get_u16_le();
18475 __struct.target_system = buf.get_u8();
18476 __struct.target_component = buf.get_u8();
18477 Ok(__struct)
18478 }
18479 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18480 let mut __tmp = BytesMut::new(bytes);
18481 #[allow(clippy::absurd_extreme_comparisons)]
18482 #[allow(unused_comparisons)]
18483 if __tmp.remaining() < Self::ENCODED_LEN {
18484 panic!(
18485 "buffer is too small (need {} bytes, but got {})",
18486 Self::ENCODED_LEN,
18487 __tmp.remaining(),
18488 )
18489 }
18490 __tmp.put_u32_le(self.ofs);
18491 __tmp.put_u32_le(self.count);
18492 __tmp.put_u16_le(self.id);
18493 __tmp.put_u8(self.target_system);
18494 __tmp.put_u8(self.target_component);
18495 if matches!(version, MavlinkVersion::V2) {
18496 let len = __tmp.len();
18497 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18498 } else {
18499 __tmp.len()
18500 }
18501 }
18502}
18503#[doc = "Stop log transfer and resume normal logging."]
18504#[doc = ""]
18505#[doc = "ID: 122"]
18506#[derive(Debug, Clone, PartialEq)]
18507#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18508#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18509#[cfg_attr(feature = "ts", derive(TS))]
18510#[cfg_attr(feature = "ts", ts(export))]
18511pub struct LOG_REQUEST_END_DATA {
18512 #[doc = "System ID"]
18513 pub target_system: u8,
18514 #[doc = "Component ID"]
18515 pub target_component: u8,
18516}
18517impl LOG_REQUEST_END_DATA {
18518 pub const ENCODED_LEN: usize = 2usize;
18519 pub const DEFAULT: Self = Self {
18520 target_system: 0_u8,
18521 target_component: 0_u8,
18522 };
18523 #[cfg(feature = "arbitrary")]
18524 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18525 use arbitrary::{Arbitrary, Unstructured};
18526 let mut buf = [0u8; 1024];
18527 rng.fill_bytes(&mut buf);
18528 let mut unstructured = Unstructured::new(&buf);
18529 Self::arbitrary(&mut unstructured).unwrap_or_default()
18530 }
18531}
18532impl Default for LOG_REQUEST_END_DATA {
18533 fn default() -> Self {
18534 Self::DEFAULT.clone()
18535 }
18536}
18537impl MessageData for LOG_REQUEST_END_DATA {
18538 type Message = MavMessage;
18539 const ID: u32 = 122u32;
18540 const NAME: &'static str = "LOG_REQUEST_END";
18541 const EXTRA_CRC: u8 = 203u8;
18542 const ENCODED_LEN: usize = 2usize;
18543 fn deser(
18544 _version: MavlinkVersion,
18545 __input: &[u8],
18546 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18547 let avail_len = __input.len();
18548 let mut payload_buf = [0; Self::ENCODED_LEN];
18549 let mut buf = if avail_len < Self::ENCODED_LEN {
18550 payload_buf[0..avail_len].copy_from_slice(__input);
18551 Bytes::new(&payload_buf)
18552 } else {
18553 Bytes::new(__input)
18554 };
18555 let mut __struct = Self::default();
18556 __struct.target_system = buf.get_u8();
18557 __struct.target_component = buf.get_u8();
18558 Ok(__struct)
18559 }
18560 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18561 let mut __tmp = BytesMut::new(bytes);
18562 #[allow(clippy::absurd_extreme_comparisons)]
18563 #[allow(unused_comparisons)]
18564 if __tmp.remaining() < Self::ENCODED_LEN {
18565 panic!(
18566 "buffer is too small (need {} bytes, but got {})",
18567 Self::ENCODED_LEN,
18568 __tmp.remaining(),
18569 )
18570 }
18571 __tmp.put_u8(self.target_system);
18572 __tmp.put_u8(self.target_component);
18573 if matches!(version, MavlinkVersion::V2) {
18574 let len = __tmp.len();
18575 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18576 } else {
18577 __tmp.len()
18578 }
18579 }
18580}
18581#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18582#[doc = ""]
18583#[doc = "ID: 117"]
18584#[derive(Debug, Clone, PartialEq)]
18585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18587#[cfg_attr(feature = "ts", derive(TS))]
18588#[cfg_attr(feature = "ts", ts(export))]
18589pub struct LOG_REQUEST_LIST_DATA {
18590 #[doc = "First log id (0 for first available)"]
18591 pub start: u16,
18592 #[doc = "Last log id (0xffff for last available)"]
18593 pub end: u16,
18594 #[doc = "System ID"]
18595 pub target_system: u8,
18596 #[doc = "Component ID"]
18597 pub target_component: u8,
18598}
18599impl LOG_REQUEST_LIST_DATA {
18600 pub const ENCODED_LEN: usize = 6usize;
18601 pub const DEFAULT: Self = Self {
18602 start: 0_u16,
18603 end: 0_u16,
18604 target_system: 0_u8,
18605 target_component: 0_u8,
18606 };
18607 #[cfg(feature = "arbitrary")]
18608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18609 use arbitrary::{Arbitrary, Unstructured};
18610 let mut buf = [0u8; 1024];
18611 rng.fill_bytes(&mut buf);
18612 let mut unstructured = Unstructured::new(&buf);
18613 Self::arbitrary(&mut unstructured).unwrap_or_default()
18614 }
18615}
18616impl Default for LOG_REQUEST_LIST_DATA {
18617 fn default() -> Self {
18618 Self::DEFAULT.clone()
18619 }
18620}
18621impl MessageData for LOG_REQUEST_LIST_DATA {
18622 type Message = MavMessage;
18623 const ID: u32 = 117u32;
18624 const NAME: &'static str = "LOG_REQUEST_LIST";
18625 const EXTRA_CRC: u8 = 128u8;
18626 const ENCODED_LEN: usize = 6usize;
18627 fn deser(
18628 _version: MavlinkVersion,
18629 __input: &[u8],
18630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18631 let avail_len = __input.len();
18632 let mut payload_buf = [0; Self::ENCODED_LEN];
18633 let mut buf = if avail_len < Self::ENCODED_LEN {
18634 payload_buf[0..avail_len].copy_from_slice(__input);
18635 Bytes::new(&payload_buf)
18636 } else {
18637 Bytes::new(__input)
18638 };
18639 let mut __struct = Self::default();
18640 __struct.start = buf.get_u16_le();
18641 __struct.end = buf.get_u16_le();
18642 __struct.target_system = buf.get_u8();
18643 __struct.target_component = buf.get_u8();
18644 Ok(__struct)
18645 }
18646 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18647 let mut __tmp = BytesMut::new(bytes);
18648 #[allow(clippy::absurd_extreme_comparisons)]
18649 #[allow(unused_comparisons)]
18650 if __tmp.remaining() < Self::ENCODED_LEN {
18651 panic!(
18652 "buffer is too small (need {} bytes, but got {})",
18653 Self::ENCODED_LEN,
18654 __tmp.remaining(),
18655 )
18656 }
18657 __tmp.put_u16_le(self.start);
18658 __tmp.put_u16_le(self.end);
18659 __tmp.put_u8(self.target_system);
18660 __tmp.put_u8(self.target_component);
18661 if matches!(version, MavlinkVersion::V2) {
18662 let len = __tmp.len();
18663 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18664 } else {
18665 __tmp.len()
18666 }
18667 }
18668}
18669#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18670#[doc = ""]
18671#[doc = "ID: 192"]
18672#[derive(Debug, Clone, PartialEq)]
18673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18675#[cfg_attr(feature = "ts", derive(TS))]
18676#[cfg_attr(feature = "ts", ts(export))]
18677pub struct MAG_CAL_REPORT_DATA {
18678 #[doc = "RMS milligauss residuals."]
18679 pub fitness: f32,
18680 #[doc = "X offset."]
18681 pub ofs_x: f32,
18682 #[doc = "Y offset."]
18683 pub ofs_y: f32,
18684 #[doc = "Z offset."]
18685 pub ofs_z: f32,
18686 #[doc = "X diagonal (matrix 11)."]
18687 pub diag_x: f32,
18688 #[doc = "Y diagonal (matrix 22)."]
18689 pub diag_y: f32,
18690 #[doc = "Z diagonal (matrix 33)."]
18691 pub diag_z: f32,
18692 #[doc = "X off-diagonal (matrix 12 and 21)."]
18693 pub offdiag_x: f32,
18694 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18695 pub offdiag_y: f32,
18696 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18697 pub offdiag_z: f32,
18698 #[doc = "Compass being calibrated."]
18699 pub compass_id: u8,
18700 #[doc = "Bitmask of compasses being calibrated."]
18701 pub cal_mask: u8,
18702 #[doc = "Calibration Status."]
18703 pub cal_status: MagCalStatus,
18704 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18705 pub autosaved: u8,
18706 #[doc = "Confidence in orientation (higher is better)."]
18707 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18708 pub orientation_confidence: f32,
18709 #[doc = "orientation before calibration."]
18710 #[cfg_attr(feature = "serde", serde(default))]
18711 pub old_orientation: MavSensorOrientation,
18712 #[doc = "orientation after calibration."]
18713 #[cfg_attr(feature = "serde", serde(default))]
18714 pub new_orientation: MavSensorOrientation,
18715 #[doc = "field radius correction factor"]
18716 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18717 pub scale_factor: f32,
18718}
18719impl MAG_CAL_REPORT_DATA {
18720 pub const ENCODED_LEN: usize = 54usize;
18721 pub const DEFAULT: Self = Self {
18722 fitness: 0.0_f32,
18723 ofs_x: 0.0_f32,
18724 ofs_y: 0.0_f32,
18725 ofs_z: 0.0_f32,
18726 diag_x: 0.0_f32,
18727 diag_y: 0.0_f32,
18728 diag_z: 0.0_f32,
18729 offdiag_x: 0.0_f32,
18730 offdiag_y: 0.0_f32,
18731 offdiag_z: 0.0_f32,
18732 compass_id: 0_u8,
18733 cal_mask: 0_u8,
18734 cal_status: MagCalStatus::DEFAULT,
18735 autosaved: 0_u8,
18736 orientation_confidence: 0.0_f32,
18737 old_orientation: MavSensorOrientation::DEFAULT,
18738 new_orientation: MavSensorOrientation::DEFAULT,
18739 scale_factor: 0.0_f32,
18740 };
18741 #[cfg(feature = "arbitrary")]
18742 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18743 use arbitrary::{Arbitrary, Unstructured};
18744 let mut buf = [0u8; 1024];
18745 rng.fill_bytes(&mut buf);
18746 let mut unstructured = Unstructured::new(&buf);
18747 Self::arbitrary(&mut unstructured).unwrap_or_default()
18748 }
18749}
18750impl Default for MAG_CAL_REPORT_DATA {
18751 fn default() -> Self {
18752 Self::DEFAULT.clone()
18753 }
18754}
18755impl MessageData for MAG_CAL_REPORT_DATA {
18756 type Message = MavMessage;
18757 const ID: u32 = 192u32;
18758 const NAME: &'static str = "MAG_CAL_REPORT";
18759 const EXTRA_CRC: u8 = 36u8;
18760 const ENCODED_LEN: usize = 54usize;
18761 fn deser(
18762 _version: MavlinkVersion,
18763 __input: &[u8],
18764 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18765 let avail_len = __input.len();
18766 let mut payload_buf = [0; Self::ENCODED_LEN];
18767 let mut buf = if avail_len < Self::ENCODED_LEN {
18768 payload_buf[0..avail_len].copy_from_slice(__input);
18769 Bytes::new(&payload_buf)
18770 } else {
18771 Bytes::new(__input)
18772 };
18773 let mut __struct = Self::default();
18774 __struct.fitness = buf.get_f32_le();
18775 __struct.ofs_x = buf.get_f32_le();
18776 __struct.ofs_y = buf.get_f32_le();
18777 __struct.ofs_z = buf.get_f32_le();
18778 __struct.diag_x = buf.get_f32_le();
18779 __struct.diag_y = buf.get_f32_le();
18780 __struct.diag_z = buf.get_f32_le();
18781 __struct.offdiag_x = buf.get_f32_le();
18782 __struct.offdiag_y = buf.get_f32_le();
18783 __struct.offdiag_z = buf.get_f32_le();
18784 __struct.compass_id = buf.get_u8();
18785 __struct.cal_mask = buf.get_u8();
18786 let tmp = buf.get_u8();
18787 __struct.cal_status =
18788 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18789 enum_type: "MagCalStatus",
18790 value: tmp as u32,
18791 })?;
18792 __struct.autosaved = buf.get_u8();
18793 __struct.orientation_confidence = buf.get_f32_le();
18794 let tmp = buf.get_u8();
18795 __struct.old_orientation =
18796 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18797 enum_type: "MavSensorOrientation",
18798 value: tmp as u32,
18799 })?;
18800 let tmp = buf.get_u8();
18801 __struct.new_orientation =
18802 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18803 enum_type: "MavSensorOrientation",
18804 value: tmp as u32,
18805 })?;
18806 __struct.scale_factor = buf.get_f32_le();
18807 Ok(__struct)
18808 }
18809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18810 let mut __tmp = BytesMut::new(bytes);
18811 #[allow(clippy::absurd_extreme_comparisons)]
18812 #[allow(unused_comparisons)]
18813 if __tmp.remaining() < Self::ENCODED_LEN {
18814 panic!(
18815 "buffer is too small (need {} bytes, but got {})",
18816 Self::ENCODED_LEN,
18817 __tmp.remaining(),
18818 )
18819 }
18820 __tmp.put_f32_le(self.fitness);
18821 __tmp.put_f32_le(self.ofs_x);
18822 __tmp.put_f32_le(self.ofs_y);
18823 __tmp.put_f32_le(self.ofs_z);
18824 __tmp.put_f32_le(self.diag_x);
18825 __tmp.put_f32_le(self.diag_y);
18826 __tmp.put_f32_le(self.diag_z);
18827 __tmp.put_f32_le(self.offdiag_x);
18828 __tmp.put_f32_le(self.offdiag_y);
18829 __tmp.put_f32_le(self.offdiag_z);
18830 __tmp.put_u8(self.compass_id);
18831 __tmp.put_u8(self.cal_mask);
18832 __tmp.put_u8(self.cal_status as u8);
18833 __tmp.put_u8(self.autosaved);
18834 if matches!(version, MavlinkVersion::V2) {
18835 __tmp.put_f32_le(self.orientation_confidence);
18836 __tmp.put_u8(self.old_orientation as u8);
18837 __tmp.put_u8(self.new_orientation as u8);
18838 __tmp.put_f32_le(self.scale_factor);
18839 let len = __tmp.len();
18840 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18841 } else {
18842 __tmp.len()
18843 }
18844 }
18845}
18846#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18847#[doc = ""]
18848#[doc = "ID: 69"]
18849#[derive(Debug, Clone, PartialEq)]
18850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18852#[cfg_attr(feature = "ts", derive(TS))]
18853#[cfg_attr(feature = "ts", ts(export))]
18854pub struct MANUAL_CONTROL_DATA {
18855 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18856 pub x: i16,
18857 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18858 pub y: i16,
18859 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18860 pub z: i16,
18861 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18862 pub r: i16,
18863 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18864 pub buttons: u16,
18865 #[doc = "The system to be controlled."]
18866 pub target: u8,
18867 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18868 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18869 pub buttons2: u16,
18870 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18871 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18872 pub enabled_extensions: u8,
18873 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18874 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18875 pub s: i16,
18876 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18877 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18878 pub t: i16,
18879 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18880 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18881 pub aux1: i16,
18882 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18883 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18884 pub aux2: i16,
18885 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18886 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18887 pub aux3: i16,
18888 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18889 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18890 pub aux4: i16,
18891 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18892 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18893 pub aux5: i16,
18894 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18895 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18896 pub aux6: i16,
18897}
18898impl MANUAL_CONTROL_DATA {
18899 pub const ENCODED_LEN: usize = 30usize;
18900 pub const DEFAULT: Self = Self {
18901 x: 0_i16,
18902 y: 0_i16,
18903 z: 0_i16,
18904 r: 0_i16,
18905 buttons: 0_u16,
18906 target: 0_u8,
18907 buttons2: 0_u16,
18908 enabled_extensions: 0_u8,
18909 s: 0_i16,
18910 t: 0_i16,
18911 aux1: 0_i16,
18912 aux2: 0_i16,
18913 aux3: 0_i16,
18914 aux4: 0_i16,
18915 aux5: 0_i16,
18916 aux6: 0_i16,
18917 };
18918 #[cfg(feature = "arbitrary")]
18919 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18920 use arbitrary::{Arbitrary, Unstructured};
18921 let mut buf = [0u8; 1024];
18922 rng.fill_bytes(&mut buf);
18923 let mut unstructured = Unstructured::new(&buf);
18924 Self::arbitrary(&mut unstructured).unwrap_or_default()
18925 }
18926}
18927impl Default for MANUAL_CONTROL_DATA {
18928 fn default() -> Self {
18929 Self::DEFAULT.clone()
18930 }
18931}
18932impl MessageData for MANUAL_CONTROL_DATA {
18933 type Message = MavMessage;
18934 const ID: u32 = 69u32;
18935 const NAME: &'static str = "MANUAL_CONTROL";
18936 const EXTRA_CRC: u8 = 243u8;
18937 const ENCODED_LEN: usize = 30usize;
18938 fn deser(
18939 _version: MavlinkVersion,
18940 __input: &[u8],
18941 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18942 let avail_len = __input.len();
18943 let mut payload_buf = [0; Self::ENCODED_LEN];
18944 let mut buf = if avail_len < Self::ENCODED_LEN {
18945 payload_buf[0..avail_len].copy_from_slice(__input);
18946 Bytes::new(&payload_buf)
18947 } else {
18948 Bytes::new(__input)
18949 };
18950 let mut __struct = Self::default();
18951 __struct.x = buf.get_i16_le();
18952 __struct.y = buf.get_i16_le();
18953 __struct.z = buf.get_i16_le();
18954 __struct.r = buf.get_i16_le();
18955 __struct.buttons = buf.get_u16_le();
18956 __struct.target = buf.get_u8();
18957 __struct.buttons2 = buf.get_u16_le();
18958 __struct.enabled_extensions = buf.get_u8();
18959 __struct.s = buf.get_i16_le();
18960 __struct.t = buf.get_i16_le();
18961 __struct.aux1 = buf.get_i16_le();
18962 __struct.aux2 = buf.get_i16_le();
18963 __struct.aux3 = buf.get_i16_le();
18964 __struct.aux4 = buf.get_i16_le();
18965 __struct.aux5 = buf.get_i16_le();
18966 __struct.aux6 = buf.get_i16_le();
18967 Ok(__struct)
18968 }
18969 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18970 let mut __tmp = BytesMut::new(bytes);
18971 #[allow(clippy::absurd_extreme_comparisons)]
18972 #[allow(unused_comparisons)]
18973 if __tmp.remaining() < Self::ENCODED_LEN {
18974 panic!(
18975 "buffer is too small (need {} bytes, but got {})",
18976 Self::ENCODED_LEN,
18977 __tmp.remaining(),
18978 )
18979 }
18980 __tmp.put_i16_le(self.x);
18981 __tmp.put_i16_le(self.y);
18982 __tmp.put_i16_le(self.z);
18983 __tmp.put_i16_le(self.r);
18984 __tmp.put_u16_le(self.buttons);
18985 __tmp.put_u8(self.target);
18986 if matches!(version, MavlinkVersion::V2) {
18987 __tmp.put_u16_le(self.buttons2);
18988 __tmp.put_u8(self.enabled_extensions);
18989 __tmp.put_i16_le(self.s);
18990 __tmp.put_i16_le(self.t);
18991 __tmp.put_i16_le(self.aux1);
18992 __tmp.put_i16_le(self.aux2);
18993 __tmp.put_i16_le(self.aux3);
18994 __tmp.put_i16_le(self.aux4);
18995 __tmp.put_i16_le(self.aux5);
18996 __tmp.put_i16_le(self.aux6);
18997 let len = __tmp.len();
18998 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18999 } else {
19000 __tmp.len()
19001 }
19002 }
19003}
19004#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19005#[doc = ""]
19006#[doc = "ID: 81"]
19007#[derive(Debug, Clone, PartialEq)]
19008#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19010#[cfg_attr(feature = "ts", derive(TS))]
19011#[cfg_attr(feature = "ts", ts(export))]
19012pub struct MANUAL_SETPOINT_DATA {
19013 #[doc = "Timestamp (time since system boot)."]
19014 pub time_boot_ms: u32,
19015 #[doc = "Desired roll rate"]
19016 pub roll: f32,
19017 #[doc = "Desired pitch rate"]
19018 pub pitch: f32,
19019 #[doc = "Desired yaw rate"]
19020 pub yaw: f32,
19021 #[doc = "Collective thrust, normalized to 0 .. 1"]
19022 pub thrust: f32,
19023 #[doc = "Flight mode switch position, 0.. 255"]
19024 pub mode_switch: u8,
19025 #[doc = "Override mode switch position, 0.. 255"]
19026 pub manual_override_switch: u8,
19027}
19028impl MANUAL_SETPOINT_DATA {
19029 pub const ENCODED_LEN: usize = 22usize;
19030 pub const DEFAULT: Self = Self {
19031 time_boot_ms: 0_u32,
19032 roll: 0.0_f32,
19033 pitch: 0.0_f32,
19034 yaw: 0.0_f32,
19035 thrust: 0.0_f32,
19036 mode_switch: 0_u8,
19037 manual_override_switch: 0_u8,
19038 };
19039 #[cfg(feature = "arbitrary")]
19040 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19041 use arbitrary::{Arbitrary, Unstructured};
19042 let mut buf = [0u8; 1024];
19043 rng.fill_bytes(&mut buf);
19044 let mut unstructured = Unstructured::new(&buf);
19045 Self::arbitrary(&mut unstructured).unwrap_or_default()
19046 }
19047}
19048impl Default for MANUAL_SETPOINT_DATA {
19049 fn default() -> Self {
19050 Self::DEFAULT.clone()
19051 }
19052}
19053impl MessageData for MANUAL_SETPOINT_DATA {
19054 type Message = MavMessage;
19055 const ID: u32 = 81u32;
19056 const NAME: &'static str = "MANUAL_SETPOINT";
19057 const EXTRA_CRC: u8 = 106u8;
19058 const ENCODED_LEN: usize = 22usize;
19059 fn deser(
19060 _version: MavlinkVersion,
19061 __input: &[u8],
19062 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19063 let avail_len = __input.len();
19064 let mut payload_buf = [0; Self::ENCODED_LEN];
19065 let mut buf = if avail_len < Self::ENCODED_LEN {
19066 payload_buf[0..avail_len].copy_from_slice(__input);
19067 Bytes::new(&payload_buf)
19068 } else {
19069 Bytes::new(__input)
19070 };
19071 let mut __struct = Self::default();
19072 __struct.time_boot_ms = buf.get_u32_le();
19073 __struct.roll = buf.get_f32_le();
19074 __struct.pitch = buf.get_f32_le();
19075 __struct.yaw = buf.get_f32_le();
19076 __struct.thrust = buf.get_f32_le();
19077 __struct.mode_switch = buf.get_u8();
19078 __struct.manual_override_switch = buf.get_u8();
19079 Ok(__struct)
19080 }
19081 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19082 let mut __tmp = BytesMut::new(bytes);
19083 #[allow(clippy::absurd_extreme_comparisons)]
19084 #[allow(unused_comparisons)]
19085 if __tmp.remaining() < Self::ENCODED_LEN {
19086 panic!(
19087 "buffer is too small (need {} bytes, but got {})",
19088 Self::ENCODED_LEN,
19089 __tmp.remaining(),
19090 )
19091 }
19092 __tmp.put_u32_le(self.time_boot_ms);
19093 __tmp.put_f32_le(self.roll);
19094 __tmp.put_f32_le(self.pitch);
19095 __tmp.put_f32_le(self.yaw);
19096 __tmp.put_f32_le(self.thrust);
19097 __tmp.put_u8(self.mode_switch);
19098 __tmp.put_u8(self.manual_override_switch);
19099 if matches!(version, MavlinkVersion::V2) {
19100 let len = __tmp.len();
19101 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19102 } else {
19103 __tmp.len()
19104 }
19105 }
19106}
19107#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19108#[doc = ""]
19109#[doc = "ID: 249"]
19110#[derive(Debug, Clone, PartialEq)]
19111#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19113#[cfg_attr(feature = "ts", derive(TS))]
19114#[cfg_attr(feature = "ts", ts(export))]
19115pub struct MEMORY_VECT_DATA {
19116 #[doc = "Starting address of the debug variables"]
19117 pub address: u16,
19118 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19119 pub ver: u8,
19120 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19121 pub mavtype: u8,
19122 #[doc = "Memory contents at specified address"]
19123 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19124 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19125 pub value: [i8; 32],
19126}
19127impl MEMORY_VECT_DATA {
19128 pub const ENCODED_LEN: usize = 36usize;
19129 pub const DEFAULT: Self = Self {
19130 address: 0_u16,
19131 ver: 0_u8,
19132 mavtype: 0_u8,
19133 value: [0_i8; 32usize],
19134 };
19135 #[cfg(feature = "arbitrary")]
19136 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19137 use arbitrary::{Arbitrary, Unstructured};
19138 let mut buf = [0u8; 1024];
19139 rng.fill_bytes(&mut buf);
19140 let mut unstructured = Unstructured::new(&buf);
19141 Self::arbitrary(&mut unstructured).unwrap_or_default()
19142 }
19143}
19144impl Default for MEMORY_VECT_DATA {
19145 fn default() -> Self {
19146 Self::DEFAULT.clone()
19147 }
19148}
19149impl MessageData for MEMORY_VECT_DATA {
19150 type Message = MavMessage;
19151 const ID: u32 = 249u32;
19152 const NAME: &'static str = "MEMORY_VECT";
19153 const EXTRA_CRC: u8 = 204u8;
19154 const ENCODED_LEN: usize = 36usize;
19155 fn deser(
19156 _version: MavlinkVersion,
19157 __input: &[u8],
19158 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19159 let avail_len = __input.len();
19160 let mut payload_buf = [0; Self::ENCODED_LEN];
19161 let mut buf = if avail_len < Self::ENCODED_LEN {
19162 payload_buf[0..avail_len].copy_from_slice(__input);
19163 Bytes::new(&payload_buf)
19164 } else {
19165 Bytes::new(__input)
19166 };
19167 let mut __struct = Self::default();
19168 __struct.address = buf.get_u16_le();
19169 __struct.ver = buf.get_u8();
19170 __struct.mavtype = buf.get_u8();
19171 for v in &mut __struct.value {
19172 let val = buf.get_i8();
19173 *v = val;
19174 }
19175 Ok(__struct)
19176 }
19177 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19178 let mut __tmp = BytesMut::new(bytes);
19179 #[allow(clippy::absurd_extreme_comparisons)]
19180 #[allow(unused_comparisons)]
19181 if __tmp.remaining() < Self::ENCODED_LEN {
19182 panic!(
19183 "buffer is too small (need {} bytes, but got {})",
19184 Self::ENCODED_LEN,
19185 __tmp.remaining(),
19186 )
19187 }
19188 __tmp.put_u16_le(self.address);
19189 __tmp.put_u8(self.ver);
19190 __tmp.put_u8(self.mavtype);
19191 for val in &self.value {
19192 __tmp.put_i8(*val);
19193 }
19194 if matches!(version, MavlinkVersion::V2) {
19195 let len = __tmp.len();
19196 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19197 } else {
19198 __tmp.len()
19199 }
19200 }
19201}
19202#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19203#[doc = ""]
19204#[doc = "ID: 244"]
19205#[derive(Debug, Clone, PartialEq)]
19206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19207#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19208#[cfg_attr(feature = "ts", derive(TS))]
19209#[cfg_attr(feature = "ts", ts(export))]
19210pub struct MESSAGE_INTERVAL_DATA {
19211 #[doc = "0 indicates the interval at which it is sent."]
19212 pub interval_us: i32,
19213 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19214 pub message_id: u16,
19215}
19216impl MESSAGE_INTERVAL_DATA {
19217 pub const ENCODED_LEN: usize = 6usize;
19218 pub const DEFAULT: Self = Self {
19219 interval_us: 0_i32,
19220 message_id: 0_u16,
19221 };
19222 #[cfg(feature = "arbitrary")]
19223 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19224 use arbitrary::{Arbitrary, Unstructured};
19225 let mut buf = [0u8; 1024];
19226 rng.fill_bytes(&mut buf);
19227 let mut unstructured = Unstructured::new(&buf);
19228 Self::arbitrary(&mut unstructured).unwrap_or_default()
19229 }
19230}
19231impl Default for MESSAGE_INTERVAL_DATA {
19232 fn default() -> Self {
19233 Self::DEFAULT.clone()
19234 }
19235}
19236impl MessageData for MESSAGE_INTERVAL_DATA {
19237 type Message = MavMessage;
19238 const ID: u32 = 244u32;
19239 const NAME: &'static str = "MESSAGE_INTERVAL";
19240 const EXTRA_CRC: u8 = 95u8;
19241 const ENCODED_LEN: usize = 6usize;
19242 fn deser(
19243 _version: MavlinkVersion,
19244 __input: &[u8],
19245 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19246 let avail_len = __input.len();
19247 let mut payload_buf = [0; Self::ENCODED_LEN];
19248 let mut buf = if avail_len < Self::ENCODED_LEN {
19249 payload_buf[0..avail_len].copy_from_slice(__input);
19250 Bytes::new(&payload_buf)
19251 } else {
19252 Bytes::new(__input)
19253 };
19254 let mut __struct = Self::default();
19255 __struct.interval_us = buf.get_i32_le();
19256 __struct.message_id = buf.get_u16_le();
19257 Ok(__struct)
19258 }
19259 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19260 let mut __tmp = BytesMut::new(bytes);
19261 #[allow(clippy::absurd_extreme_comparisons)]
19262 #[allow(unused_comparisons)]
19263 if __tmp.remaining() < Self::ENCODED_LEN {
19264 panic!(
19265 "buffer is too small (need {} bytes, but got {})",
19266 Self::ENCODED_LEN,
19267 __tmp.remaining(),
19268 )
19269 }
19270 __tmp.put_i32_le(self.interval_us);
19271 __tmp.put_u16_le(self.message_id);
19272 if matches!(version, MavlinkVersion::V2) {
19273 let len = __tmp.len();
19274 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19275 } else {
19276 __tmp.len()
19277 }
19278 }
19279}
19280#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19281#[doc = ""]
19282#[doc = "ID: 47"]
19283#[derive(Debug, Clone, PartialEq)]
19284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19286#[cfg_attr(feature = "ts", derive(TS))]
19287#[cfg_attr(feature = "ts", ts(export))]
19288pub struct MISSION_ACK_DATA {
19289 #[doc = "System ID"]
19290 pub target_system: u8,
19291 #[doc = "Component ID"]
19292 pub target_component: u8,
19293 #[doc = "Mission result."]
19294 pub mavtype: MavMissionResult,
19295 #[doc = "Mission type."]
19296 #[cfg_attr(feature = "serde", serde(default))]
19297 pub mission_type: MavMissionType,
19298 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19299 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19300 pub opaque_id: u32,
19301}
19302impl MISSION_ACK_DATA {
19303 pub const ENCODED_LEN: usize = 8usize;
19304 pub const DEFAULT: Self = Self {
19305 target_system: 0_u8,
19306 target_component: 0_u8,
19307 mavtype: MavMissionResult::DEFAULT,
19308 mission_type: MavMissionType::DEFAULT,
19309 opaque_id: 0_u32,
19310 };
19311 #[cfg(feature = "arbitrary")]
19312 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19313 use arbitrary::{Arbitrary, Unstructured};
19314 let mut buf = [0u8; 1024];
19315 rng.fill_bytes(&mut buf);
19316 let mut unstructured = Unstructured::new(&buf);
19317 Self::arbitrary(&mut unstructured).unwrap_or_default()
19318 }
19319}
19320impl Default for MISSION_ACK_DATA {
19321 fn default() -> Self {
19322 Self::DEFAULT.clone()
19323 }
19324}
19325impl MessageData for MISSION_ACK_DATA {
19326 type Message = MavMessage;
19327 const ID: u32 = 47u32;
19328 const NAME: &'static str = "MISSION_ACK";
19329 const EXTRA_CRC: u8 = 153u8;
19330 const ENCODED_LEN: usize = 8usize;
19331 fn deser(
19332 _version: MavlinkVersion,
19333 __input: &[u8],
19334 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19335 let avail_len = __input.len();
19336 let mut payload_buf = [0; Self::ENCODED_LEN];
19337 let mut buf = if avail_len < Self::ENCODED_LEN {
19338 payload_buf[0..avail_len].copy_from_slice(__input);
19339 Bytes::new(&payload_buf)
19340 } else {
19341 Bytes::new(__input)
19342 };
19343 let mut __struct = Self::default();
19344 __struct.target_system = buf.get_u8();
19345 __struct.target_component = buf.get_u8();
19346 let tmp = buf.get_u8();
19347 __struct.mavtype =
19348 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19349 enum_type: "MavMissionResult",
19350 value: tmp as u32,
19351 })?;
19352 let tmp = buf.get_u8();
19353 __struct.mission_type =
19354 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19355 enum_type: "MavMissionType",
19356 value: tmp as u32,
19357 })?;
19358 __struct.opaque_id = buf.get_u32_le();
19359 Ok(__struct)
19360 }
19361 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19362 let mut __tmp = BytesMut::new(bytes);
19363 #[allow(clippy::absurd_extreme_comparisons)]
19364 #[allow(unused_comparisons)]
19365 if __tmp.remaining() < Self::ENCODED_LEN {
19366 panic!(
19367 "buffer is too small (need {} bytes, but got {})",
19368 Self::ENCODED_LEN,
19369 __tmp.remaining(),
19370 )
19371 }
19372 __tmp.put_u8(self.target_system);
19373 __tmp.put_u8(self.target_component);
19374 __tmp.put_u8(self.mavtype as u8);
19375 if matches!(version, MavlinkVersion::V2) {
19376 __tmp.put_u8(self.mission_type as u8);
19377 __tmp.put_u32_le(self.opaque_id);
19378 let len = __tmp.len();
19379 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19380 } else {
19381 __tmp.len()
19382 }
19383 }
19384}
19385#[doc = "Delete all mission items at once."]
19386#[doc = ""]
19387#[doc = "ID: 45"]
19388#[derive(Debug, Clone, PartialEq)]
19389#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19390#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19391#[cfg_attr(feature = "ts", derive(TS))]
19392#[cfg_attr(feature = "ts", ts(export))]
19393pub struct MISSION_CLEAR_ALL_DATA {
19394 #[doc = "System ID"]
19395 pub target_system: u8,
19396 #[doc = "Component ID"]
19397 pub target_component: u8,
19398 #[doc = "Mission type."]
19399 #[cfg_attr(feature = "serde", serde(default))]
19400 pub mission_type: MavMissionType,
19401}
19402impl MISSION_CLEAR_ALL_DATA {
19403 pub const ENCODED_LEN: usize = 3usize;
19404 pub const DEFAULT: Self = Self {
19405 target_system: 0_u8,
19406 target_component: 0_u8,
19407 mission_type: MavMissionType::DEFAULT,
19408 };
19409 #[cfg(feature = "arbitrary")]
19410 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19411 use arbitrary::{Arbitrary, Unstructured};
19412 let mut buf = [0u8; 1024];
19413 rng.fill_bytes(&mut buf);
19414 let mut unstructured = Unstructured::new(&buf);
19415 Self::arbitrary(&mut unstructured).unwrap_or_default()
19416 }
19417}
19418impl Default for MISSION_CLEAR_ALL_DATA {
19419 fn default() -> Self {
19420 Self::DEFAULT.clone()
19421 }
19422}
19423impl MessageData for MISSION_CLEAR_ALL_DATA {
19424 type Message = MavMessage;
19425 const ID: u32 = 45u32;
19426 const NAME: &'static str = "MISSION_CLEAR_ALL";
19427 const EXTRA_CRC: u8 = 232u8;
19428 const ENCODED_LEN: usize = 3usize;
19429 fn deser(
19430 _version: MavlinkVersion,
19431 __input: &[u8],
19432 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19433 let avail_len = __input.len();
19434 let mut payload_buf = [0; Self::ENCODED_LEN];
19435 let mut buf = if avail_len < Self::ENCODED_LEN {
19436 payload_buf[0..avail_len].copy_from_slice(__input);
19437 Bytes::new(&payload_buf)
19438 } else {
19439 Bytes::new(__input)
19440 };
19441 let mut __struct = Self::default();
19442 __struct.target_system = buf.get_u8();
19443 __struct.target_component = buf.get_u8();
19444 let tmp = buf.get_u8();
19445 __struct.mission_type =
19446 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19447 enum_type: "MavMissionType",
19448 value: tmp as u32,
19449 })?;
19450 Ok(__struct)
19451 }
19452 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19453 let mut __tmp = BytesMut::new(bytes);
19454 #[allow(clippy::absurd_extreme_comparisons)]
19455 #[allow(unused_comparisons)]
19456 if __tmp.remaining() < Self::ENCODED_LEN {
19457 panic!(
19458 "buffer is too small (need {} bytes, but got {})",
19459 Self::ENCODED_LEN,
19460 __tmp.remaining(),
19461 )
19462 }
19463 __tmp.put_u8(self.target_system);
19464 __tmp.put_u8(self.target_component);
19465 if matches!(version, MavlinkVersion::V2) {
19466 __tmp.put_u8(self.mission_type as u8);
19467 let len = __tmp.len();
19468 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19469 } else {
19470 __tmp.len()
19471 }
19472 }
19473}
19474#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19475#[doc = ""]
19476#[doc = "ID: 44"]
19477#[derive(Debug, Clone, PartialEq)]
19478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19480#[cfg_attr(feature = "ts", derive(TS))]
19481#[cfg_attr(feature = "ts", ts(export))]
19482pub struct MISSION_COUNT_DATA {
19483 #[doc = "Number of mission items in the sequence"]
19484 pub count: u16,
19485 #[doc = "System ID"]
19486 pub target_system: u8,
19487 #[doc = "Component ID"]
19488 pub target_component: u8,
19489 #[doc = "Mission type."]
19490 #[cfg_attr(feature = "serde", serde(default))]
19491 pub mission_type: MavMissionType,
19492 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19493 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19494 pub opaque_id: u32,
19495}
19496impl MISSION_COUNT_DATA {
19497 pub const ENCODED_LEN: usize = 9usize;
19498 pub const DEFAULT: Self = Self {
19499 count: 0_u16,
19500 target_system: 0_u8,
19501 target_component: 0_u8,
19502 mission_type: MavMissionType::DEFAULT,
19503 opaque_id: 0_u32,
19504 };
19505 #[cfg(feature = "arbitrary")]
19506 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19507 use arbitrary::{Arbitrary, Unstructured};
19508 let mut buf = [0u8; 1024];
19509 rng.fill_bytes(&mut buf);
19510 let mut unstructured = Unstructured::new(&buf);
19511 Self::arbitrary(&mut unstructured).unwrap_or_default()
19512 }
19513}
19514impl Default for MISSION_COUNT_DATA {
19515 fn default() -> Self {
19516 Self::DEFAULT.clone()
19517 }
19518}
19519impl MessageData for MISSION_COUNT_DATA {
19520 type Message = MavMessage;
19521 const ID: u32 = 44u32;
19522 const NAME: &'static str = "MISSION_COUNT";
19523 const EXTRA_CRC: u8 = 221u8;
19524 const ENCODED_LEN: usize = 9usize;
19525 fn deser(
19526 _version: MavlinkVersion,
19527 __input: &[u8],
19528 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19529 let avail_len = __input.len();
19530 let mut payload_buf = [0; Self::ENCODED_LEN];
19531 let mut buf = if avail_len < Self::ENCODED_LEN {
19532 payload_buf[0..avail_len].copy_from_slice(__input);
19533 Bytes::new(&payload_buf)
19534 } else {
19535 Bytes::new(__input)
19536 };
19537 let mut __struct = Self::default();
19538 __struct.count = buf.get_u16_le();
19539 __struct.target_system = buf.get_u8();
19540 __struct.target_component = buf.get_u8();
19541 let tmp = buf.get_u8();
19542 __struct.mission_type =
19543 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19544 enum_type: "MavMissionType",
19545 value: tmp as u32,
19546 })?;
19547 __struct.opaque_id = buf.get_u32_le();
19548 Ok(__struct)
19549 }
19550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19551 let mut __tmp = BytesMut::new(bytes);
19552 #[allow(clippy::absurd_extreme_comparisons)]
19553 #[allow(unused_comparisons)]
19554 if __tmp.remaining() < Self::ENCODED_LEN {
19555 panic!(
19556 "buffer is too small (need {} bytes, but got {})",
19557 Self::ENCODED_LEN,
19558 __tmp.remaining(),
19559 )
19560 }
19561 __tmp.put_u16_le(self.count);
19562 __tmp.put_u8(self.target_system);
19563 __tmp.put_u8(self.target_component);
19564 if matches!(version, MavlinkVersion::V2) {
19565 __tmp.put_u8(self.mission_type as u8);
19566 __tmp.put_u32_le(self.opaque_id);
19567 let len = __tmp.len();
19568 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19569 } else {
19570 __tmp.len()
19571 }
19572 }
19573}
19574#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19575#[doc = ""]
19576#[doc = "ID: 42"]
19577#[derive(Debug, Clone, PartialEq)]
19578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19580#[cfg_attr(feature = "ts", derive(TS))]
19581#[cfg_attr(feature = "ts", ts(export))]
19582pub struct MISSION_CURRENT_DATA {
19583 #[doc = "Sequence"]
19584 pub seq: u16,
19585 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19586 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19587 pub total: u16,
19588 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19589 #[cfg_attr(feature = "serde", serde(default))]
19590 pub mission_state: MissionState,
19591 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19592 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19593 pub mission_mode: u8,
19594 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19595 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19596 pub mission_id: u32,
19597 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19598 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19599 pub fence_id: u32,
19600 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19601 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19602 pub rally_points_id: u32,
19603}
19604impl MISSION_CURRENT_DATA {
19605 pub const ENCODED_LEN: usize = 18usize;
19606 pub const DEFAULT: Self = Self {
19607 seq: 0_u16,
19608 total: 0_u16,
19609 mission_state: MissionState::DEFAULT,
19610 mission_mode: 0_u8,
19611 mission_id: 0_u32,
19612 fence_id: 0_u32,
19613 rally_points_id: 0_u32,
19614 };
19615 #[cfg(feature = "arbitrary")]
19616 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19617 use arbitrary::{Arbitrary, Unstructured};
19618 let mut buf = [0u8; 1024];
19619 rng.fill_bytes(&mut buf);
19620 let mut unstructured = Unstructured::new(&buf);
19621 Self::arbitrary(&mut unstructured).unwrap_or_default()
19622 }
19623}
19624impl Default for MISSION_CURRENT_DATA {
19625 fn default() -> Self {
19626 Self::DEFAULT.clone()
19627 }
19628}
19629impl MessageData for MISSION_CURRENT_DATA {
19630 type Message = MavMessage;
19631 const ID: u32 = 42u32;
19632 const NAME: &'static str = "MISSION_CURRENT";
19633 const EXTRA_CRC: u8 = 28u8;
19634 const ENCODED_LEN: usize = 18usize;
19635 fn deser(
19636 _version: MavlinkVersion,
19637 __input: &[u8],
19638 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19639 let avail_len = __input.len();
19640 let mut payload_buf = [0; Self::ENCODED_LEN];
19641 let mut buf = if avail_len < Self::ENCODED_LEN {
19642 payload_buf[0..avail_len].copy_from_slice(__input);
19643 Bytes::new(&payload_buf)
19644 } else {
19645 Bytes::new(__input)
19646 };
19647 let mut __struct = Self::default();
19648 __struct.seq = buf.get_u16_le();
19649 __struct.total = buf.get_u16_le();
19650 let tmp = buf.get_u8();
19651 __struct.mission_state =
19652 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19653 enum_type: "MissionState",
19654 value: tmp as u32,
19655 })?;
19656 __struct.mission_mode = buf.get_u8();
19657 __struct.mission_id = buf.get_u32_le();
19658 __struct.fence_id = buf.get_u32_le();
19659 __struct.rally_points_id = buf.get_u32_le();
19660 Ok(__struct)
19661 }
19662 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19663 let mut __tmp = BytesMut::new(bytes);
19664 #[allow(clippy::absurd_extreme_comparisons)]
19665 #[allow(unused_comparisons)]
19666 if __tmp.remaining() < Self::ENCODED_LEN {
19667 panic!(
19668 "buffer is too small (need {} bytes, but got {})",
19669 Self::ENCODED_LEN,
19670 __tmp.remaining(),
19671 )
19672 }
19673 __tmp.put_u16_le(self.seq);
19674 if matches!(version, MavlinkVersion::V2) {
19675 __tmp.put_u16_le(self.total);
19676 __tmp.put_u8(self.mission_state as u8);
19677 __tmp.put_u8(self.mission_mode);
19678 __tmp.put_u32_le(self.mission_id);
19679 __tmp.put_u32_le(self.fence_id);
19680 __tmp.put_u32_le(self.rally_points_id);
19681 let len = __tmp.len();
19682 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19683 } else {
19684 __tmp.len()
19685 }
19686 }
19687}
19688#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19689#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19690#[doc = ""]
19691#[doc = "ID: 39"]
19692#[derive(Debug, Clone, PartialEq)]
19693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19695#[cfg_attr(feature = "ts", derive(TS))]
19696#[cfg_attr(feature = "ts", ts(export))]
19697pub struct MISSION_ITEM_DATA {
19698 #[doc = "PARAM1, see MAV_CMD enum"]
19699 pub param1: f32,
19700 #[doc = "PARAM2, see MAV_CMD enum"]
19701 pub param2: f32,
19702 #[doc = "PARAM3, see MAV_CMD enum"]
19703 pub param3: f32,
19704 #[doc = "PARAM4, see MAV_CMD enum"]
19705 pub param4: f32,
19706 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19707 pub x: f32,
19708 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19709 pub y: f32,
19710 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19711 pub z: f32,
19712 #[doc = "Sequence"]
19713 pub seq: u16,
19714 #[doc = "The scheduled action for the waypoint."]
19715 pub command: MavCmd,
19716 #[doc = "System ID"]
19717 pub target_system: u8,
19718 #[doc = "Component ID"]
19719 pub target_component: u8,
19720 #[doc = "The coordinate system of the waypoint."]
19721 pub frame: MavFrame,
19722 #[doc = "false:0, true:1"]
19723 pub current: u8,
19724 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19725 pub autocontinue: u8,
19726 #[doc = "Mission type."]
19727 #[cfg_attr(feature = "serde", serde(default))]
19728 pub mission_type: MavMissionType,
19729}
19730impl MISSION_ITEM_DATA {
19731 pub const ENCODED_LEN: usize = 38usize;
19732 pub const DEFAULT: Self = Self {
19733 param1: 0.0_f32,
19734 param2: 0.0_f32,
19735 param3: 0.0_f32,
19736 param4: 0.0_f32,
19737 x: 0.0_f32,
19738 y: 0.0_f32,
19739 z: 0.0_f32,
19740 seq: 0_u16,
19741 command: MavCmd::DEFAULT,
19742 target_system: 0_u8,
19743 target_component: 0_u8,
19744 frame: MavFrame::DEFAULT,
19745 current: 0_u8,
19746 autocontinue: 0_u8,
19747 mission_type: MavMissionType::DEFAULT,
19748 };
19749 #[cfg(feature = "arbitrary")]
19750 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19751 use arbitrary::{Arbitrary, Unstructured};
19752 let mut buf = [0u8; 1024];
19753 rng.fill_bytes(&mut buf);
19754 let mut unstructured = Unstructured::new(&buf);
19755 Self::arbitrary(&mut unstructured).unwrap_or_default()
19756 }
19757}
19758impl Default for MISSION_ITEM_DATA {
19759 fn default() -> Self {
19760 Self::DEFAULT.clone()
19761 }
19762}
19763impl MessageData for MISSION_ITEM_DATA {
19764 type Message = MavMessage;
19765 const ID: u32 = 39u32;
19766 const NAME: &'static str = "MISSION_ITEM";
19767 const EXTRA_CRC: u8 = 254u8;
19768 const ENCODED_LEN: usize = 38usize;
19769 fn deser(
19770 _version: MavlinkVersion,
19771 __input: &[u8],
19772 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19773 let avail_len = __input.len();
19774 let mut payload_buf = [0; Self::ENCODED_LEN];
19775 let mut buf = if avail_len < Self::ENCODED_LEN {
19776 payload_buf[0..avail_len].copy_from_slice(__input);
19777 Bytes::new(&payload_buf)
19778 } else {
19779 Bytes::new(__input)
19780 };
19781 let mut __struct = Self::default();
19782 __struct.param1 = buf.get_f32_le();
19783 __struct.param2 = buf.get_f32_le();
19784 __struct.param3 = buf.get_f32_le();
19785 __struct.param4 = buf.get_f32_le();
19786 __struct.x = buf.get_f32_le();
19787 __struct.y = buf.get_f32_le();
19788 __struct.z = buf.get_f32_le();
19789 __struct.seq = buf.get_u16_le();
19790 let tmp = buf.get_u16_le();
19791 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19792 ::mavlink_core::error::ParserError::InvalidEnum {
19793 enum_type: "MavCmd",
19794 value: tmp as u32,
19795 },
19796 )?;
19797 __struct.target_system = buf.get_u8();
19798 __struct.target_component = buf.get_u8();
19799 let tmp = buf.get_u8();
19800 __struct.frame =
19801 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19802 enum_type: "MavFrame",
19803 value: tmp as u32,
19804 })?;
19805 __struct.current = buf.get_u8();
19806 __struct.autocontinue = buf.get_u8();
19807 let tmp = buf.get_u8();
19808 __struct.mission_type =
19809 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19810 enum_type: "MavMissionType",
19811 value: tmp as u32,
19812 })?;
19813 Ok(__struct)
19814 }
19815 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19816 let mut __tmp = BytesMut::new(bytes);
19817 #[allow(clippy::absurd_extreme_comparisons)]
19818 #[allow(unused_comparisons)]
19819 if __tmp.remaining() < Self::ENCODED_LEN {
19820 panic!(
19821 "buffer is too small (need {} bytes, but got {})",
19822 Self::ENCODED_LEN,
19823 __tmp.remaining(),
19824 )
19825 }
19826 __tmp.put_f32_le(self.param1);
19827 __tmp.put_f32_le(self.param2);
19828 __tmp.put_f32_le(self.param3);
19829 __tmp.put_f32_le(self.param4);
19830 __tmp.put_f32_le(self.x);
19831 __tmp.put_f32_le(self.y);
19832 __tmp.put_f32_le(self.z);
19833 __tmp.put_u16_le(self.seq);
19834 __tmp.put_u16_le(self.command as u16);
19835 __tmp.put_u8(self.target_system);
19836 __tmp.put_u8(self.target_component);
19837 __tmp.put_u8(self.frame as u8);
19838 __tmp.put_u8(self.current);
19839 __tmp.put_u8(self.autocontinue);
19840 if matches!(version, MavlinkVersion::V2) {
19841 __tmp.put_u8(self.mission_type as u8);
19842 let len = __tmp.len();
19843 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19844 } else {
19845 __tmp.len()
19846 }
19847 }
19848}
19849#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19850#[doc = ""]
19851#[doc = "ID: 73"]
19852#[derive(Debug, Clone, PartialEq)]
19853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19854#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19855#[cfg_attr(feature = "ts", derive(TS))]
19856#[cfg_attr(feature = "ts", ts(export))]
19857pub struct MISSION_ITEM_INT_DATA {
19858 #[doc = "PARAM1, see MAV_CMD enum"]
19859 pub param1: f32,
19860 #[doc = "PARAM2, see MAV_CMD enum"]
19861 pub param2: f32,
19862 #[doc = "PARAM3, see MAV_CMD enum"]
19863 pub param3: f32,
19864 #[doc = "PARAM4, see MAV_CMD enum"]
19865 pub param4: f32,
19866 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19867 pub x: i32,
19868 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19869 pub y: i32,
19870 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19871 pub z: f32,
19872 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19873 pub seq: u16,
19874 #[doc = "The scheduled action for the waypoint."]
19875 pub command: MavCmd,
19876 #[doc = "System ID"]
19877 pub target_system: u8,
19878 #[doc = "Component ID"]
19879 pub target_component: u8,
19880 #[doc = "The coordinate system of the waypoint."]
19881 pub frame: MavFrame,
19882 #[doc = "false:0, true:1"]
19883 pub current: u8,
19884 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19885 pub autocontinue: u8,
19886 #[doc = "Mission type."]
19887 #[cfg_attr(feature = "serde", serde(default))]
19888 pub mission_type: MavMissionType,
19889}
19890impl MISSION_ITEM_INT_DATA {
19891 pub const ENCODED_LEN: usize = 38usize;
19892 pub const DEFAULT: Self = Self {
19893 param1: 0.0_f32,
19894 param2: 0.0_f32,
19895 param3: 0.0_f32,
19896 param4: 0.0_f32,
19897 x: 0_i32,
19898 y: 0_i32,
19899 z: 0.0_f32,
19900 seq: 0_u16,
19901 command: MavCmd::DEFAULT,
19902 target_system: 0_u8,
19903 target_component: 0_u8,
19904 frame: MavFrame::DEFAULT,
19905 current: 0_u8,
19906 autocontinue: 0_u8,
19907 mission_type: MavMissionType::DEFAULT,
19908 };
19909 #[cfg(feature = "arbitrary")]
19910 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19911 use arbitrary::{Arbitrary, Unstructured};
19912 let mut buf = [0u8; 1024];
19913 rng.fill_bytes(&mut buf);
19914 let mut unstructured = Unstructured::new(&buf);
19915 Self::arbitrary(&mut unstructured).unwrap_or_default()
19916 }
19917}
19918impl Default for MISSION_ITEM_INT_DATA {
19919 fn default() -> Self {
19920 Self::DEFAULT.clone()
19921 }
19922}
19923impl MessageData for MISSION_ITEM_INT_DATA {
19924 type Message = MavMessage;
19925 const ID: u32 = 73u32;
19926 const NAME: &'static str = "MISSION_ITEM_INT";
19927 const EXTRA_CRC: u8 = 38u8;
19928 const ENCODED_LEN: usize = 38usize;
19929 fn deser(
19930 _version: MavlinkVersion,
19931 __input: &[u8],
19932 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19933 let avail_len = __input.len();
19934 let mut payload_buf = [0; Self::ENCODED_LEN];
19935 let mut buf = if avail_len < Self::ENCODED_LEN {
19936 payload_buf[0..avail_len].copy_from_slice(__input);
19937 Bytes::new(&payload_buf)
19938 } else {
19939 Bytes::new(__input)
19940 };
19941 let mut __struct = Self::default();
19942 __struct.param1 = buf.get_f32_le();
19943 __struct.param2 = buf.get_f32_le();
19944 __struct.param3 = buf.get_f32_le();
19945 __struct.param4 = buf.get_f32_le();
19946 __struct.x = buf.get_i32_le();
19947 __struct.y = buf.get_i32_le();
19948 __struct.z = buf.get_f32_le();
19949 __struct.seq = buf.get_u16_le();
19950 let tmp = buf.get_u16_le();
19951 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19952 ::mavlink_core::error::ParserError::InvalidEnum {
19953 enum_type: "MavCmd",
19954 value: tmp as u32,
19955 },
19956 )?;
19957 __struct.target_system = buf.get_u8();
19958 __struct.target_component = buf.get_u8();
19959 let tmp = buf.get_u8();
19960 __struct.frame =
19961 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19962 enum_type: "MavFrame",
19963 value: tmp as u32,
19964 })?;
19965 __struct.current = buf.get_u8();
19966 __struct.autocontinue = buf.get_u8();
19967 let tmp = buf.get_u8();
19968 __struct.mission_type =
19969 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19970 enum_type: "MavMissionType",
19971 value: tmp as u32,
19972 })?;
19973 Ok(__struct)
19974 }
19975 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19976 let mut __tmp = BytesMut::new(bytes);
19977 #[allow(clippy::absurd_extreme_comparisons)]
19978 #[allow(unused_comparisons)]
19979 if __tmp.remaining() < Self::ENCODED_LEN {
19980 panic!(
19981 "buffer is too small (need {} bytes, but got {})",
19982 Self::ENCODED_LEN,
19983 __tmp.remaining(),
19984 )
19985 }
19986 __tmp.put_f32_le(self.param1);
19987 __tmp.put_f32_le(self.param2);
19988 __tmp.put_f32_le(self.param3);
19989 __tmp.put_f32_le(self.param4);
19990 __tmp.put_i32_le(self.x);
19991 __tmp.put_i32_le(self.y);
19992 __tmp.put_f32_le(self.z);
19993 __tmp.put_u16_le(self.seq);
19994 __tmp.put_u16_le(self.command as u16);
19995 __tmp.put_u8(self.target_system);
19996 __tmp.put_u8(self.target_component);
19997 __tmp.put_u8(self.frame as u8);
19998 __tmp.put_u8(self.current);
19999 __tmp.put_u8(self.autocontinue);
20000 if matches!(version, MavlinkVersion::V2) {
20001 __tmp.put_u8(self.mission_type as u8);
20002 let len = __tmp.len();
20003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20004 } else {
20005 __tmp.len()
20006 }
20007 }
20008}
20009#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20010#[doc = ""]
20011#[doc = "ID: 46"]
20012#[derive(Debug, Clone, PartialEq)]
20013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20015#[cfg_attr(feature = "ts", derive(TS))]
20016#[cfg_attr(feature = "ts", ts(export))]
20017pub struct MISSION_ITEM_REACHED_DATA {
20018 #[doc = "Sequence"]
20019 pub seq: u16,
20020}
20021impl MISSION_ITEM_REACHED_DATA {
20022 pub const ENCODED_LEN: usize = 2usize;
20023 pub const DEFAULT: Self = Self { seq: 0_u16 };
20024 #[cfg(feature = "arbitrary")]
20025 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20026 use arbitrary::{Arbitrary, Unstructured};
20027 let mut buf = [0u8; 1024];
20028 rng.fill_bytes(&mut buf);
20029 let mut unstructured = Unstructured::new(&buf);
20030 Self::arbitrary(&mut unstructured).unwrap_or_default()
20031 }
20032}
20033impl Default for MISSION_ITEM_REACHED_DATA {
20034 fn default() -> Self {
20035 Self::DEFAULT.clone()
20036 }
20037}
20038impl MessageData for MISSION_ITEM_REACHED_DATA {
20039 type Message = MavMessage;
20040 const ID: u32 = 46u32;
20041 const NAME: &'static str = "MISSION_ITEM_REACHED";
20042 const EXTRA_CRC: u8 = 11u8;
20043 const ENCODED_LEN: usize = 2usize;
20044 fn deser(
20045 _version: MavlinkVersion,
20046 __input: &[u8],
20047 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20048 let avail_len = __input.len();
20049 let mut payload_buf = [0; Self::ENCODED_LEN];
20050 let mut buf = if avail_len < Self::ENCODED_LEN {
20051 payload_buf[0..avail_len].copy_from_slice(__input);
20052 Bytes::new(&payload_buf)
20053 } else {
20054 Bytes::new(__input)
20055 };
20056 let mut __struct = Self::default();
20057 __struct.seq = buf.get_u16_le();
20058 Ok(__struct)
20059 }
20060 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20061 let mut __tmp = BytesMut::new(bytes);
20062 #[allow(clippy::absurd_extreme_comparisons)]
20063 #[allow(unused_comparisons)]
20064 if __tmp.remaining() < Self::ENCODED_LEN {
20065 panic!(
20066 "buffer is too small (need {} bytes, but got {})",
20067 Self::ENCODED_LEN,
20068 __tmp.remaining(),
20069 )
20070 }
20071 __tmp.put_u16_le(self.seq);
20072 if matches!(version, MavlinkVersion::V2) {
20073 let len = __tmp.len();
20074 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20075 } else {
20076 __tmp.len()
20077 }
20078 }
20079}
20080#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20081#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20082#[doc = ""]
20083#[doc = "ID: 40"]
20084#[derive(Debug, Clone, PartialEq)]
20085#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20087#[cfg_attr(feature = "ts", derive(TS))]
20088#[cfg_attr(feature = "ts", ts(export))]
20089pub struct MISSION_REQUEST_DATA {
20090 #[doc = "Sequence"]
20091 pub seq: u16,
20092 #[doc = "System ID"]
20093 pub target_system: u8,
20094 #[doc = "Component ID"]
20095 pub target_component: u8,
20096 #[doc = "Mission type."]
20097 #[cfg_attr(feature = "serde", serde(default))]
20098 pub mission_type: MavMissionType,
20099}
20100impl MISSION_REQUEST_DATA {
20101 pub const ENCODED_LEN: usize = 5usize;
20102 pub const DEFAULT: Self = Self {
20103 seq: 0_u16,
20104 target_system: 0_u8,
20105 target_component: 0_u8,
20106 mission_type: MavMissionType::DEFAULT,
20107 };
20108 #[cfg(feature = "arbitrary")]
20109 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20110 use arbitrary::{Arbitrary, Unstructured};
20111 let mut buf = [0u8; 1024];
20112 rng.fill_bytes(&mut buf);
20113 let mut unstructured = Unstructured::new(&buf);
20114 Self::arbitrary(&mut unstructured).unwrap_or_default()
20115 }
20116}
20117impl Default for MISSION_REQUEST_DATA {
20118 fn default() -> Self {
20119 Self::DEFAULT.clone()
20120 }
20121}
20122impl MessageData for MISSION_REQUEST_DATA {
20123 type Message = MavMessage;
20124 const ID: u32 = 40u32;
20125 const NAME: &'static str = "MISSION_REQUEST";
20126 const EXTRA_CRC: u8 = 230u8;
20127 const ENCODED_LEN: usize = 5usize;
20128 fn deser(
20129 _version: MavlinkVersion,
20130 __input: &[u8],
20131 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20132 let avail_len = __input.len();
20133 let mut payload_buf = [0; Self::ENCODED_LEN];
20134 let mut buf = if avail_len < Self::ENCODED_LEN {
20135 payload_buf[0..avail_len].copy_from_slice(__input);
20136 Bytes::new(&payload_buf)
20137 } else {
20138 Bytes::new(__input)
20139 };
20140 let mut __struct = Self::default();
20141 __struct.seq = buf.get_u16_le();
20142 __struct.target_system = buf.get_u8();
20143 __struct.target_component = buf.get_u8();
20144 let tmp = buf.get_u8();
20145 __struct.mission_type =
20146 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20147 enum_type: "MavMissionType",
20148 value: tmp as u32,
20149 })?;
20150 Ok(__struct)
20151 }
20152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20153 let mut __tmp = BytesMut::new(bytes);
20154 #[allow(clippy::absurd_extreme_comparisons)]
20155 #[allow(unused_comparisons)]
20156 if __tmp.remaining() < Self::ENCODED_LEN {
20157 panic!(
20158 "buffer is too small (need {} bytes, but got {})",
20159 Self::ENCODED_LEN,
20160 __tmp.remaining(),
20161 )
20162 }
20163 __tmp.put_u16_le(self.seq);
20164 __tmp.put_u8(self.target_system);
20165 __tmp.put_u8(self.target_component);
20166 if matches!(version, MavlinkVersion::V2) {
20167 __tmp.put_u8(self.mission_type as u8);
20168 let len = __tmp.len();
20169 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20170 } else {
20171 __tmp.len()
20172 }
20173 }
20174}
20175#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20176#[doc = ""]
20177#[doc = "ID: 51"]
20178#[derive(Debug, Clone, PartialEq)]
20179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20180#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20181#[cfg_attr(feature = "ts", derive(TS))]
20182#[cfg_attr(feature = "ts", ts(export))]
20183pub struct MISSION_REQUEST_INT_DATA {
20184 #[doc = "Sequence"]
20185 pub seq: u16,
20186 #[doc = "System ID"]
20187 pub target_system: u8,
20188 #[doc = "Component ID"]
20189 pub target_component: u8,
20190 #[doc = "Mission type."]
20191 #[cfg_attr(feature = "serde", serde(default))]
20192 pub mission_type: MavMissionType,
20193}
20194impl MISSION_REQUEST_INT_DATA {
20195 pub const ENCODED_LEN: usize = 5usize;
20196 pub const DEFAULT: Self = Self {
20197 seq: 0_u16,
20198 target_system: 0_u8,
20199 target_component: 0_u8,
20200 mission_type: MavMissionType::DEFAULT,
20201 };
20202 #[cfg(feature = "arbitrary")]
20203 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20204 use arbitrary::{Arbitrary, Unstructured};
20205 let mut buf = [0u8; 1024];
20206 rng.fill_bytes(&mut buf);
20207 let mut unstructured = Unstructured::new(&buf);
20208 Self::arbitrary(&mut unstructured).unwrap_or_default()
20209 }
20210}
20211impl Default for MISSION_REQUEST_INT_DATA {
20212 fn default() -> Self {
20213 Self::DEFAULT.clone()
20214 }
20215}
20216impl MessageData for MISSION_REQUEST_INT_DATA {
20217 type Message = MavMessage;
20218 const ID: u32 = 51u32;
20219 const NAME: &'static str = "MISSION_REQUEST_INT";
20220 const EXTRA_CRC: u8 = 196u8;
20221 const ENCODED_LEN: usize = 5usize;
20222 fn deser(
20223 _version: MavlinkVersion,
20224 __input: &[u8],
20225 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20226 let avail_len = __input.len();
20227 let mut payload_buf = [0; Self::ENCODED_LEN];
20228 let mut buf = if avail_len < Self::ENCODED_LEN {
20229 payload_buf[0..avail_len].copy_from_slice(__input);
20230 Bytes::new(&payload_buf)
20231 } else {
20232 Bytes::new(__input)
20233 };
20234 let mut __struct = Self::default();
20235 __struct.seq = buf.get_u16_le();
20236 __struct.target_system = buf.get_u8();
20237 __struct.target_component = buf.get_u8();
20238 let tmp = buf.get_u8();
20239 __struct.mission_type =
20240 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20241 enum_type: "MavMissionType",
20242 value: tmp as u32,
20243 })?;
20244 Ok(__struct)
20245 }
20246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20247 let mut __tmp = BytesMut::new(bytes);
20248 #[allow(clippy::absurd_extreme_comparisons)]
20249 #[allow(unused_comparisons)]
20250 if __tmp.remaining() < Self::ENCODED_LEN {
20251 panic!(
20252 "buffer is too small (need {} bytes, but got {})",
20253 Self::ENCODED_LEN,
20254 __tmp.remaining(),
20255 )
20256 }
20257 __tmp.put_u16_le(self.seq);
20258 __tmp.put_u8(self.target_system);
20259 __tmp.put_u8(self.target_component);
20260 if matches!(version, MavlinkVersion::V2) {
20261 __tmp.put_u8(self.mission_type as u8);
20262 let len = __tmp.len();
20263 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20264 } else {
20265 __tmp.len()
20266 }
20267 }
20268}
20269#[doc = "Request the overall list of mission items from the system/component."]
20270#[doc = ""]
20271#[doc = "ID: 43"]
20272#[derive(Debug, Clone, PartialEq)]
20273#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20274#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20275#[cfg_attr(feature = "ts", derive(TS))]
20276#[cfg_attr(feature = "ts", ts(export))]
20277pub struct MISSION_REQUEST_LIST_DATA {
20278 #[doc = "System ID"]
20279 pub target_system: u8,
20280 #[doc = "Component ID"]
20281 pub target_component: u8,
20282 #[doc = "Mission type."]
20283 #[cfg_attr(feature = "serde", serde(default))]
20284 pub mission_type: MavMissionType,
20285}
20286impl MISSION_REQUEST_LIST_DATA {
20287 pub const ENCODED_LEN: usize = 3usize;
20288 pub const DEFAULT: Self = Self {
20289 target_system: 0_u8,
20290 target_component: 0_u8,
20291 mission_type: MavMissionType::DEFAULT,
20292 };
20293 #[cfg(feature = "arbitrary")]
20294 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20295 use arbitrary::{Arbitrary, Unstructured};
20296 let mut buf = [0u8; 1024];
20297 rng.fill_bytes(&mut buf);
20298 let mut unstructured = Unstructured::new(&buf);
20299 Self::arbitrary(&mut unstructured).unwrap_or_default()
20300 }
20301}
20302impl Default for MISSION_REQUEST_LIST_DATA {
20303 fn default() -> Self {
20304 Self::DEFAULT.clone()
20305 }
20306}
20307impl MessageData for MISSION_REQUEST_LIST_DATA {
20308 type Message = MavMessage;
20309 const ID: u32 = 43u32;
20310 const NAME: &'static str = "MISSION_REQUEST_LIST";
20311 const EXTRA_CRC: u8 = 132u8;
20312 const ENCODED_LEN: usize = 3usize;
20313 fn deser(
20314 _version: MavlinkVersion,
20315 __input: &[u8],
20316 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20317 let avail_len = __input.len();
20318 let mut payload_buf = [0; Self::ENCODED_LEN];
20319 let mut buf = if avail_len < Self::ENCODED_LEN {
20320 payload_buf[0..avail_len].copy_from_slice(__input);
20321 Bytes::new(&payload_buf)
20322 } else {
20323 Bytes::new(__input)
20324 };
20325 let mut __struct = Self::default();
20326 __struct.target_system = buf.get_u8();
20327 __struct.target_component = buf.get_u8();
20328 let tmp = buf.get_u8();
20329 __struct.mission_type =
20330 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20331 enum_type: "MavMissionType",
20332 value: tmp as u32,
20333 })?;
20334 Ok(__struct)
20335 }
20336 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20337 let mut __tmp = BytesMut::new(bytes);
20338 #[allow(clippy::absurd_extreme_comparisons)]
20339 #[allow(unused_comparisons)]
20340 if __tmp.remaining() < Self::ENCODED_LEN {
20341 panic!(
20342 "buffer is too small (need {} bytes, but got {})",
20343 Self::ENCODED_LEN,
20344 __tmp.remaining(),
20345 )
20346 }
20347 __tmp.put_u8(self.target_system);
20348 __tmp.put_u8(self.target_component);
20349 if matches!(version, MavlinkVersion::V2) {
20350 __tmp.put_u8(self.mission_type as u8);
20351 let len = __tmp.len();
20352 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20353 } else {
20354 __tmp.len()
20355 }
20356 }
20357}
20358#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20359#[doc = ""]
20360#[doc = "ID: 37"]
20361#[derive(Debug, Clone, PartialEq)]
20362#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20363#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20364#[cfg_attr(feature = "ts", derive(TS))]
20365#[cfg_attr(feature = "ts", ts(export))]
20366pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20367 #[doc = "Start index"]
20368 pub start_index: i16,
20369 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20370 pub end_index: i16,
20371 #[doc = "System ID"]
20372 pub target_system: u8,
20373 #[doc = "Component ID"]
20374 pub target_component: u8,
20375 #[doc = "Mission type."]
20376 #[cfg_attr(feature = "serde", serde(default))]
20377 pub mission_type: MavMissionType,
20378}
20379impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20380 pub const ENCODED_LEN: usize = 7usize;
20381 pub const DEFAULT: Self = Self {
20382 start_index: 0_i16,
20383 end_index: 0_i16,
20384 target_system: 0_u8,
20385 target_component: 0_u8,
20386 mission_type: MavMissionType::DEFAULT,
20387 };
20388 #[cfg(feature = "arbitrary")]
20389 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20390 use arbitrary::{Arbitrary, Unstructured};
20391 let mut buf = [0u8; 1024];
20392 rng.fill_bytes(&mut buf);
20393 let mut unstructured = Unstructured::new(&buf);
20394 Self::arbitrary(&mut unstructured).unwrap_or_default()
20395 }
20396}
20397impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20398 fn default() -> Self {
20399 Self::DEFAULT.clone()
20400 }
20401}
20402impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20403 type Message = MavMessage;
20404 const ID: u32 = 37u32;
20405 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20406 const EXTRA_CRC: u8 = 212u8;
20407 const ENCODED_LEN: usize = 7usize;
20408 fn deser(
20409 _version: MavlinkVersion,
20410 __input: &[u8],
20411 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20412 let avail_len = __input.len();
20413 let mut payload_buf = [0; Self::ENCODED_LEN];
20414 let mut buf = if avail_len < Self::ENCODED_LEN {
20415 payload_buf[0..avail_len].copy_from_slice(__input);
20416 Bytes::new(&payload_buf)
20417 } else {
20418 Bytes::new(__input)
20419 };
20420 let mut __struct = Self::default();
20421 __struct.start_index = buf.get_i16_le();
20422 __struct.end_index = buf.get_i16_le();
20423 __struct.target_system = buf.get_u8();
20424 __struct.target_component = buf.get_u8();
20425 let tmp = buf.get_u8();
20426 __struct.mission_type =
20427 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20428 enum_type: "MavMissionType",
20429 value: tmp as u32,
20430 })?;
20431 Ok(__struct)
20432 }
20433 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20434 let mut __tmp = BytesMut::new(bytes);
20435 #[allow(clippy::absurd_extreme_comparisons)]
20436 #[allow(unused_comparisons)]
20437 if __tmp.remaining() < Self::ENCODED_LEN {
20438 panic!(
20439 "buffer is too small (need {} bytes, but got {})",
20440 Self::ENCODED_LEN,
20441 __tmp.remaining(),
20442 )
20443 }
20444 __tmp.put_i16_le(self.start_index);
20445 __tmp.put_i16_le(self.end_index);
20446 __tmp.put_u8(self.target_system);
20447 __tmp.put_u8(self.target_component);
20448 if matches!(version, MavlinkVersion::V2) {
20449 __tmp.put_u8(self.mission_type as u8);
20450 let len = __tmp.len();
20451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20452 } else {
20453 __tmp.len()
20454 }
20455 }
20456}
20457#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20458#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20459#[doc = ""]
20460#[doc = "ID: 41"]
20461#[derive(Debug, Clone, PartialEq)]
20462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20463#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20464#[cfg_attr(feature = "ts", derive(TS))]
20465#[cfg_attr(feature = "ts", ts(export))]
20466pub struct MISSION_SET_CURRENT_DATA {
20467 #[doc = "Sequence"]
20468 pub seq: u16,
20469 #[doc = "System ID"]
20470 pub target_system: u8,
20471 #[doc = "Component ID"]
20472 pub target_component: u8,
20473}
20474impl MISSION_SET_CURRENT_DATA {
20475 pub const ENCODED_LEN: usize = 4usize;
20476 pub const DEFAULT: Self = Self {
20477 seq: 0_u16,
20478 target_system: 0_u8,
20479 target_component: 0_u8,
20480 };
20481 #[cfg(feature = "arbitrary")]
20482 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20483 use arbitrary::{Arbitrary, Unstructured};
20484 let mut buf = [0u8; 1024];
20485 rng.fill_bytes(&mut buf);
20486 let mut unstructured = Unstructured::new(&buf);
20487 Self::arbitrary(&mut unstructured).unwrap_or_default()
20488 }
20489}
20490impl Default for MISSION_SET_CURRENT_DATA {
20491 fn default() -> Self {
20492 Self::DEFAULT.clone()
20493 }
20494}
20495impl MessageData for MISSION_SET_CURRENT_DATA {
20496 type Message = MavMessage;
20497 const ID: u32 = 41u32;
20498 const NAME: &'static str = "MISSION_SET_CURRENT";
20499 const EXTRA_CRC: u8 = 28u8;
20500 const ENCODED_LEN: usize = 4usize;
20501 fn deser(
20502 _version: MavlinkVersion,
20503 __input: &[u8],
20504 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20505 let avail_len = __input.len();
20506 let mut payload_buf = [0; Self::ENCODED_LEN];
20507 let mut buf = if avail_len < Self::ENCODED_LEN {
20508 payload_buf[0..avail_len].copy_from_slice(__input);
20509 Bytes::new(&payload_buf)
20510 } else {
20511 Bytes::new(__input)
20512 };
20513 let mut __struct = Self::default();
20514 __struct.seq = buf.get_u16_le();
20515 __struct.target_system = buf.get_u8();
20516 __struct.target_component = buf.get_u8();
20517 Ok(__struct)
20518 }
20519 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20520 let mut __tmp = BytesMut::new(bytes);
20521 #[allow(clippy::absurd_extreme_comparisons)]
20522 #[allow(unused_comparisons)]
20523 if __tmp.remaining() < Self::ENCODED_LEN {
20524 panic!(
20525 "buffer is too small (need {} bytes, but got {})",
20526 Self::ENCODED_LEN,
20527 __tmp.remaining(),
20528 )
20529 }
20530 __tmp.put_u16_le(self.seq);
20531 __tmp.put_u8(self.target_system);
20532 __tmp.put_u8(self.target_component);
20533 if matches!(version, MavlinkVersion::V2) {
20534 let len = __tmp.len();
20535 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20536 } else {
20537 __tmp.len()
20538 }
20539 }
20540}
20541#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20542#[doc = ""]
20543#[doc = "ID: 38"]
20544#[derive(Debug, Clone, PartialEq)]
20545#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20547#[cfg_attr(feature = "ts", derive(TS))]
20548#[cfg_attr(feature = "ts", ts(export))]
20549pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20550 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20551 pub start_index: i16,
20552 #[doc = "End index, equal or greater than start index."]
20553 pub end_index: i16,
20554 #[doc = "System ID"]
20555 pub target_system: u8,
20556 #[doc = "Component ID"]
20557 pub target_component: u8,
20558 #[doc = "Mission type."]
20559 #[cfg_attr(feature = "serde", serde(default))]
20560 pub mission_type: MavMissionType,
20561}
20562impl MISSION_WRITE_PARTIAL_LIST_DATA {
20563 pub const ENCODED_LEN: usize = 7usize;
20564 pub const DEFAULT: Self = Self {
20565 start_index: 0_i16,
20566 end_index: 0_i16,
20567 target_system: 0_u8,
20568 target_component: 0_u8,
20569 mission_type: MavMissionType::DEFAULT,
20570 };
20571 #[cfg(feature = "arbitrary")]
20572 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20573 use arbitrary::{Arbitrary, Unstructured};
20574 let mut buf = [0u8; 1024];
20575 rng.fill_bytes(&mut buf);
20576 let mut unstructured = Unstructured::new(&buf);
20577 Self::arbitrary(&mut unstructured).unwrap_or_default()
20578 }
20579}
20580impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20581 fn default() -> Self {
20582 Self::DEFAULT.clone()
20583 }
20584}
20585impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20586 type Message = MavMessage;
20587 const ID: u32 = 38u32;
20588 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20589 const EXTRA_CRC: u8 = 9u8;
20590 const ENCODED_LEN: usize = 7usize;
20591 fn deser(
20592 _version: MavlinkVersion,
20593 __input: &[u8],
20594 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20595 let avail_len = __input.len();
20596 let mut payload_buf = [0; Self::ENCODED_LEN];
20597 let mut buf = if avail_len < Self::ENCODED_LEN {
20598 payload_buf[0..avail_len].copy_from_slice(__input);
20599 Bytes::new(&payload_buf)
20600 } else {
20601 Bytes::new(__input)
20602 };
20603 let mut __struct = Self::default();
20604 __struct.start_index = buf.get_i16_le();
20605 __struct.end_index = buf.get_i16_le();
20606 __struct.target_system = buf.get_u8();
20607 __struct.target_component = buf.get_u8();
20608 let tmp = buf.get_u8();
20609 __struct.mission_type =
20610 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20611 enum_type: "MavMissionType",
20612 value: tmp as u32,
20613 })?;
20614 Ok(__struct)
20615 }
20616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20617 let mut __tmp = BytesMut::new(bytes);
20618 #[allow(clippy::absurd_extreme_comparisons)]
20619 #[allow(unused_comparisons)]
20620 if __tmp.remaining() < Self::ENCODED_LEN {
20621 panic!(
20622 "buffer is too small (need {} bytes, but got {})",
20623 Self::ENCODED_LEN,
20624 __tmp.remaining(),
20625 )
20626 }
20627 __tmp.put_i16_le(self.start_index);
20628 __tmp.put_i16_le(self.end_index);
20629 __tmp.put_u8(self.target_system);
20630 __tmp.put_u8(self.target_component);
20631 if matches!(version, MavlinkVersion::V2) {
20632 __tmp.put_u8(self.mission_type as u8);
20633 let len = __tmp.len();
20634 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20635 } else {
20636 __tmp.len()
20637 }
20638 }
20639}
20640#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20641#[doc = "Orientation of a mount."]
20642#[doc = ""]
20643#[doc = "ID: 265"]
20644#[derive(Debug, Clone, PartialEq)]
20645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20647#[cfg_attr(feature = "ts", derive(TS))]
20648#[cfg_attr(feature = "ts", ts(export))]
20649pub struct MOUNT_ORIENTATION_DATA {
20650 #[doc = "Timestamp (time since system boot)."]
20651 pub time_boot_ms: u32,
20652 #[doc = "Roll in global frame (set to NaN for invalid)."]
20653 pub roll: f32,
20654 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20655 pub pitch: f32,
20656 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20657 pub yaw: f32,
20658 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20659 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20660 pub yaw_absolute: f32,
20661}
20662impl MOUNT_ORIENTATION_DATA {
20663 pub const ENCODED_LEN: usize = 20usize;
20664 pub const DEFAULT: Self = Self {
20665 time_boot_ms: 0_u32,
20666 roll: 0.0_f32,
20667 pitch: 0.0_f32,
20668 yaw: 0.0_f32,
20669 yaw_absolute: 0.0_f32,
20670 };
20671 #[cfg(feature = "arbitrary")]
20672 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20673 use arbitrary::{Arbitrary, Unstructured};
20674 let mut buf = [0u8; 1024];
20675 rng.fill_bytes(&mut buf);
20676 let mut unstructured = Unstructured::new(&buf);
20677 Self::arbitrary(&mut unstructured).unwrap_or_default()
20678 }
20679}
20680impl Default for MOUNT_ORIENTATION_DATA {
20681 fn default() -> Self {
20682 Self::DEFAULT.clone()
20683 }
20684}
20685impl MessageData for MOUNT_ORIENTATION_DATA {
20686 type Message = MavMessage;
20687 const ID: u32 = 265u32;
20688 const NAME: &'static str = "MOUNT_ORIENTATION";
20689 const EXTRA_CRC: u8 = 26u8;
20690 const ENCODED_LEN: usize = 20usize;
20691 fn deser(
20692 _version: MavlinkVersion,
20693 __input: &[u8],
20694 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20695 let avail_len = __input.len();
20696 let mut payload_buf = [0; Self::ENCODED_LEN];
20697 let mut buf = if avail_len < Self::ENCODED_LEN {
20698 payload_buf[0..avail_len].copy_from_slice(__input);
20699 Bytes::new(&payload_buf)
20700 } else {
20701 Bytes::new(__input)
20702 };
20703 let mut __struct = Self::default();
20704 __struct.time_boot_ms = buf.get_u32_le();
20705 __struct.roll = buf.get_f32_le();
20706 __struct.pitch = buf.get_f32_le();
20707 __struct.yaw = buf.get_f32_le();
20708 __struct.yaw_absolute = buf.get_f32_le();
20709 Ok(__struct)
20710 }
20711 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20712 let mut __tmp = BytesMut::new(bytes);
20713 #[allow(clippy::absurd_extreme_comparisons)]
20714 #[allow(unused_comparisons)]
20715 if __tmp.remaining() < Self::ENCODED_LEN {
20716 panic!(
20717 "buffer is too small (need {} bytes, but got {})",
20718 Self::ENCODED_LEN,
20719 __tmp.remaining(),
20720 )
20721 }
20722 __tmp.put_u32_le(self.time_boot_ms);
20723 __tmp.put_f32_le(self.roll);
20724 __tmp.put_f32_le(self.pitch);
20725 __tmp.put_f32_le(self.yaw);
20726 if matches!(version, MavlinkVersion::V2) {
20727 __tmp.put_f32_le(self.yaw_absolute);
20728 let len = __tmp.len();
20729 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20730 } else {
20731 __tmp.len()
20732 }
20733 }
20734}
20735#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20736#[doc = ""]
20737#[doc = "ID: 251"]
20738#[derive(Debug, Clone, PartialEq)]
20739#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20741#[cfg_attr(feature = "ts", derive(TS))]
20742#[cfg_attr(feature = "ts", ts(export))]
20743pub struct NAMED_VALUE_FLOAT_DATA {
20744 #[doc = "Timestamp (time since system boot)."]
20745 pub time_boot_ms: u32,
20746 #[doc = "Floating point value"]
20747 pub value: f32,
20748 #[doc = "Name of the debug variable"]
20749 #[cfg_attr(
20750 feature = "serde",
20751 serde(
20752 serialize_with = "crate::nulstr::serialize::<_, 10>",
20753 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
20754 )
20755 )]
20756 #[cfg_attr(feature = "ts", ts(type = "string"))]
20757 pub name: [u8; 10],
20758}
20759impl NAMED_VALUE_FLOAT_DATA {
20760 pub const ENCODED_LEN: usize = 18usize;
20761 pub const DEFAULT: Self = Self {
20762 time_boot_ms: 0_u32,
20763 value: 0.0_f32,
20764 name: [0_u8; 10usize],
20765 };
20766 #[cfg(feature = "arbitrary")]
20767 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20768 use arbitrary::{Arbitrary, Unstructured};
20769 let mut buf = [0u8; 1024];
20770 rng.fill_bytes(&mut buf);
20771 let mut unstructured = Unstructured::new(&buf);
20772 Self::arbitrary(&mut unstructured).unwrap_or_default()
20773 }
20774}
20775impl Default for NAMED_VALUE_FLOAT_DATA {
20776 fn default() -> Self {
20777 Self::DEFAULT.clone()
20778 }
20779}
20780impl MessageData for NAMED_VALUE_FLOAT_DATA {
20781 type Message = MavMessage;
20782 const ID: u32 = 251u32;
20783 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20784 const EXTRA_CRC: u8 = 170u8;
20785 const ENCODED_LEN: usize = 18usize;
20786 fn deser(
20787 _version: MavlinkVersion,
20788 __input: &[u8],
20789 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20790 let avail_len = __input.len();
20791 let mut payload_buf = [0; Self::ENCODED_LEN];
20792 let mut buf = if avail_len < Self::ENCODED_LEN {
20793 payload_buf[0..avail_len].copy_from_slice(__input);
20794 Bytes::new(&payload_buf)
20795 } else {
20796 Bytes::new(__input)
20797 };
20798 let mut __struct = Self::default();
20799 __struct.time_boot_ms = buf.get_u32_le();
20800 __struct.value = buf.get_f32_le();
20801 for v in &mut __struct.name {
20802 let val = buf.get_u8();
20803 *v = val;
20804 }
20805 Ok(__struct)
20806 }
20807 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20808 let mut __tmp = BytesMut::new(bytes);
20809 #[allow(clippy::absurd_extreme_comparisons)]
20810 #[allow(unused_comparisons)]
20811 if __tmp.remaining() < Self::ENCODED_LEN {
20812 panic!(
20813 "buffer is too small (need {} bytes, but got {})",
20814 Self::ENCODED_LEN,
20815 __tmp.remaining(),
20816 )
20817 }
20818 __tmp.put_u32_le(self.time_boot_ms);
20819 __tmp.put_f32_le(self.value);
20820 for val in &self.name {
20821 __tmp.put_u8(*val);
20822 }
20823 if matches!(version, MavlinkVersion::V2) {
20824 let len = __tmp.len();
20825 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20826 } else {
20827 __tmp.len()
20828 }
20829 }
20830}
20831#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20832#[doc = ""]
20833#[doc = "ID: 252"]
20834#[derive(Debug, Clone, PartialEq)]
20835#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20837#[cfg_attr(feature = "ts", derive(TS))]
20838#[cfg_attr(feature = "ts", ts(export))]
20839pub struct NAMED_VALUE_INT_DATA {
20840 #[doc = "Timestamp (time since system boot)."]
20841 pub time_boot_ms: u32,
20842 #[doc = "Signed integer value"]
20843 pub value: i32,
20844 #[doc = "Name of the debug variable"]
20845 #[cfg_attr(
20846 feature = "serde",
20847 serde(
20848 serialize_with = "crate::nulstr::serialize::<_, 10>",
20849 deserialize_with = "crate::nulstr::deserialize::<_, 10>"
20850 )
20851 )]
20852 #[cfg_attr(feature = "ts", ts(type = "string"))]
20853 pub name: [u8; 10],
20854}
20855impl NAMED_VALUE_INT_DATA {
20856 pub const ENCODED_LEN: usize = 18usize;
20857 pub const DEFAULT: Self = Self {
20858 time_boot_ms: 0_u32,
20859 value: 0_i32,
20860 name: [0_u8; 10usize],
20861 };
20862 #[cfg(feature = "arbitrary")]
20863 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20864 use arbitrary::{Arbitrary, Unstructured};
20865 let mut buf = [0u8; 1024];
20866 rng.fill_bytes(&mut buf);
20867 let mut unstructured = Unstructured::new(&buf);
20868 Self::arbitrary(&mut unstructured).unwrap_or_default()
20869 }
20870}
20871impl Default for NAMED_VALUE_INT_DATA {
20872 fn default() -> Self {
20873 Self::DEFAULT.clone()
20874 }
20875}
20876impl MessageData for NAMED_VALUE_INT_DATA {
20877 type Message = MavMessage;
20878 const ID: u32 = 252u32;
20879 const NAME: &'static str = "NAMED_VALUE_INT";
20880 const EXTRA_CRC: u8 = 44u8;
20881 const ENCODED_LEN: usize = 18usize;
20882 fn deser(
20883 _version: MavlinkVersion,
20884 __input: &[u8],
20885 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20886 let avail_len = __input.len();
20887 let mut payload_buf = [0; Self::ENCODED_LEN];
20888 let mut buf = if avail_len < Self::ENCODED_LEN {
20889 payload_buf[0..avail_len].copy_from_slice(__input);
20890 Bytes::new(&payload_buf)
20891 } else {
20892 Bytes::new(__input)
20893 };
20894 let mut __struct = Self::default();
20895 __struct.time_boot_ms = buf.get_u32_le();
20896 __struct.value = buf.get_i32_le();
20897 for v in &mut __struct.name {
20898 let val = buf.get_u8();
20899 *v = val;
20900 }
20901 Ok(__struct)
20902 }
20903 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20904 let mut __tmp = BytesMut::new(bytes);
20905 #[allow(clippy::absurd_extreme_comparisons)]
20906 #[allow(unused_comparisons)]
20907 if __tmp.remaining() < Self::ENCODED_LEN {
20908 panic!(
20909 "buffer is too small (need {} bytes, but got {})",
20910 Self::ENCODED_LEN,
20911 __tmp.remaining(),
20912 )
20913 }
20914 __tmp.put_u32_le(self.time_boot_ms);
20915 __tmp.put_i32_le(self.value);
20916 for val in &self.name {
20917 __tmp.put_u8(*val);
20918 }
20919 if matches!(version, MavlinkVersion::V2) {
20920 let len = __tmp.len();
20921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20922 } else {
20923 __tmp.len()
20924 }
20925 }
20926}
20927#[doc = "The state of the navigation and position controller."]
20928#[doc = ""]
20929#[doc = "ID: 62"]
20930#[derive(Debug, Clone, PartialEq)]
20931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20933#[cfg_attr(feature = "ts", derive(TS))]
20934#[cfg_attr(feature = "ts", ts(export))]
20935pub struct NAV_CONTROLLER_OUTPUT_DATA {
20936 #[doc = "Current desired roll"]
20937 pub nav_roll: f32,
20938 #[doc = "Current desired pitch"]
20939 pub nav_pitch: f32,
20940 #[doc = "Current altitude error"]
20941 pub alt_error: f32,
20942 #[doc = "Current airspeed error"]
20943 pub aspd_error: f32,
20944 #[doc = "Current crosstrack error on x-y plane"]
20945 pub xtrack_error: f32,
20946 #[doc = "Current desired heading"]
20947 pub nav_bearing: i16,
20948 #[doc = "Bearing to current waypoint/target"]
20949 pub target_bearing: i16,
20950 #[doc = "Distance to active waypoint"]
20951 pub wp_dist: u16,
20952}
20953impl NAV_CONTROLLER_OUTPUT_DATA {
20954 pub const ENCODED_LEN: usize = 26usize;
20955 pub const DEFAULT: Self = Self {
20956 nav_roll: 0.0_f32,
20957 nav_pitch: 0.0_f32,
20958 alt_error: 0.0_f32,
20959 aspd_error: 0.0_f32,
20960 xtrack_error: 0.0_f32,
20961 nav_bearing: 0_i16,
20962 target_bearing: 0_i16,
20963 wp_dist: 0_u16,
20964 };
20965 #[cfg(feature = "arbitrary")]
20966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20967 use arbitrary::{Arbitrary, Unstructured};
20968 let mut buf = [0u8; 1024];
20969 rng.fill_bytes(&mut buf);
20970 let mut unstructured = Unstructured::new(&buf);
20971 Self::arbitrary(&mut unstructured).unwrap_or_default()
20972 }
20973}
20974impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20975 fn default() -> Self {
20976 Self::DEFAULT.clone()
20977 }
20978}
20979impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20980 type Message = MavMessage;
20981 const ID: u32 = 62u32;
20982 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20983 const EXTRA_CRC: u8 = 183u8;
20984 const ENCODED_LEN: usize = 26usize;
20985 fn deser(
20986 _version: MavlinkVersion,
20987 __input: &[u8],
20988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20989 let avail_len = __input.len();
20990 let mut payload_buf = [0; Self::ENCODED_LEN];
20991 let mut buf = if avail_len < Self::ENCODED_LEN {
20992 payload_buf[0..avail_len].copy_from_slice(__input);
20993 Bytes::new(&payload_buf)
20994 } else {
20995 Bytes::new(__input)
20996 };
20997 let mut __struct = Self::default();
20998 __struct.nav_roll = buf.get_f32_le();
20999 __struct.nav_pitch = buf.get_f32_le();
21000 __struct.alt_error = buf.get_f32_le();
21001 __struct.aspd_error = buf.get_f32_le();
21002 __struct.xtrack_error = buf.get_f32_le();
21003 __struct.nav_bearing = buf.get_i16_le();
21004 __struct.target_bearing = buf.get_i16_le();
21005 __struct.wp_dist = buf.get_u16_le();
21006 Ok(__struct)
21007 }
21008 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21009 let mut __tmp = BytesMut::new(bytes);
21010 #[allow(clippy::absurd_extreme_comparisons)]
21011 #[allow(unused_comparisons)]
21012 if __tmp.remaining() < Self::ENCODED_LEN {
21013 panic!(
21014 "buffer is too small (need {} bytes, but got {})",
21015 Self::ENCODED_LEN,
21016 __tmp.remaining(),
21017 )
21018 }
21019 __tmp.put_f32_le(self.nav_roll);
21020 __tmp.put_f32_le(self.nav_pitch);
21021 __tmp.put_f32_le(self.alt_error);
21022 __tmp.put_f32_le(self.aspd_error);
21023 __tmp.put_f32_le(self.xtrack_error);
21024 __tmp.put_i16_le(self.nav_bearing);
21025 __tmp.put_i16_le(self.target_bearing);
21026 __tmp.put_u16_le(self.wp_dist);
21027 if matches!(version, MavlinkVersion::V2) {
21028 let len = __tmp.len();
21029 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21030 } else {
21031 __tmp.len()
21032 }
21033 }
21034}
21035#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21036#[doc = ""]
21037#[doc = "ID: 330"]
21038#[derive(Debug, Clone, PartialEq)]
21039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21040#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21041#[cfg_attr(feature = "ts", derive(TS))]
21042#[cfg_attr(feature = "ts", ts(export))]
21043pub struct OBSTACLE_DISTANCE_DATA {
21044 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21045 pub time_usec: u64,
21046 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21047 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21048 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21049 pub distances: [u16; 72],
21050 #[doc = "Minimum distance the sensor can measure."]
21051 pub min_distance: u16,
21052 #[doc = "Maximum distance the sensor can measure."]
21053 pub max_distance: u16,
21054 #[doc = "Class id of the distance sensor type."]
21055 pub sensor_type: MavDistanceSensor,
21056 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21057 pub increment: u8,
21058 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21059 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21060 pub increment_f: f32,
21061 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21062 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21063 pub angle_offset: f32,
21064 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21065 #[cfg_attr(feature = "serde", serde(default))]
21066 pub frame: MavFrame,
21067}
21068impl OBSTACLE_DISTANCE_DATA {
21069 pub const ENCODED_LEN: usize = 167usize;
21070 pub const DEFAULT: Self = Self {
21071 time_usec: 0_u64,
21072 distances: [0_u16; 72usize],
21073 min_distance: 0_u16,
21074 max_distance: 0_u16,
21075 sensor_type: MavDistanceSensor::DEFAULT,
21076 increment: 0_u8,
21077 increment_f: 0.0_f32,
21078 angle_offset: 0.0_f32,
21079 frame: MavFrame::DEFAULT,
21080 };
21081 #[cfg(feature = "arbitrary")]
21082 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21083 use arbitrary::{Arbitrary, Unstructured};
21084 let mut buf = [0u8; 1024];
21085 rng.fill_bytes(&mut buf);
21086 let mut unstructured = Unstructured::new(&buf);
21087 Self::arbitrary(&mut unstructured).unwrap_or_default()
21088 }
21089}
21090impl Default for OBSTACLE_DISTANCE_DATA {
21091 fn default() -> Self {
21092 Self::DEFAULT.clone()
21093 }
21094}
21095impl MessageData for OBSTACLE_DISTANCE_DATA {
21096 type Message = MavMessage;
21097 const ID: u32 = 330u32;
21098 const NAME: &'static str = "OBSTACLE_DISTANCE";
21099 const EXTRA_CRC: u8 = 23u8;
21100 const ENCODED_LEN: usize = 167usize;
21101 fn deser(
21102 _version: MavlinkVersion,
21103 __input: &[u8],
21104 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21105 let avail_len = __input.len();
21106 let mut payload_buf = [0; Self::ENCODED_LEN];
21107 let mut buf = if avail_len < Self::ENCODED_LEN {
21108 payload_buf[0..avail_len].copy_from_slice(__input);
21109 Bytes::new(&payload_buf)
21110 } else {
21111 Bytes::new(__input)
21112 };
21113 let mut __struct = Self::default();
21114 __struct.time_usec = buf.get_u64_le();
21115 for v in &mut __struct.distances {
21116 let val = buf.get_u16_le();
21117 *v = val;
21118 }
21119 __struct.min_distance = buf.get_u16_le();
21120 __struct.max_distance = buf.get_u16_le();
21121 let tmp = buf.get_u8();
21122 __struct.sensor_type =
21123 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21124 enum_type: "MavDistanceSensor",
21125 value: tmp as u32,
21126 })?;
21127 __struct.increment = buf.get_u8();
21128 __struct.increment_f = buf.get_f32_le();
21129 __struct.angle_offset = buf.get_f32_le();
21130 let tmp = buf.get_u8();
21131 __struct.frame =
21132 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21133 enum_type: "MavFrame",
21134 value: tmp as u32,
21135 })?;
21136 Ok(__struct)
21137 }
21138 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21139 let mut __tmp = BytesMut::new(bytes);
21140 #[allow(clippy::absurd_extreme_comparisons)]
21141 #[allow(unused_comparisons)]
21142 if __tmp.remaining() < Self::ENCODED_LEN {
21143 panic!(
21144 "buffer is too small (need {} bytes, but got {})",
21145 Self::ENCODED_LEN,
21146 __tmp.remaining(),
21147 )
21148 }
21149 __tmp.put_u64_le(self.time_usec);
21150 for val in &self.distances {
21151 __tmp.put_u16_le(*val);
21152 }
21153 __tmp.put_u16_le(self.min_distance);
21154 __tmp.put_u16_le(self.max_distance);
21155 __tmp.put_u8(self.sensor_type as u8);
21156 __tmp.put_u8(self.increment);
21157 if matches!(version, MavlinkVersion::V2) {
21158 __tmp.put_f32_le(self.increment_f);
21159 __tmp.put_f32_le(self.angle_offset);
21160 __tmp.put_u8(self.frame as u8);
21161 let len = __tmp.len();
21162 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21163 } else {
21164 __tmp.len()
21165 }
21166 }
21167}
21168#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21169#[doc = ""]
21170#[doc = "ID: 331"]
21171#[derive(Debug, Clone, PartialEq)]
21172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21174#[cfg_attr(feature = "ts", derive(TS))]
21175#[cfg_attr(feature = "ts", ts(export))]
21176pub struct ODOMETRY_DATA {
21177 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21178 pub time_usec: u64,
21179 #[doc = "X Position"]
21180 pub x: f32,
21181 #[doc = "Y Position"]
21182 pub y: f32,
21183 #[doc = "Z Position"]
21184 pub z: f32,
21185 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21186 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21187 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21188 pub q: [f32; 4],
21189 #[doc = "X linear speed"]
21190 pub vx: f32,
21191 #[doc = "Y linear speed"]
21192 pub vy: f32,
21193 #[doc = "Z linear speed"]
21194 pub vz: f32,
21195 #[doc = "Roll angular speed"]
21196 pub rollspeed: f32,
21197 #[doc = "Pitch angular speed"]
21198 pub pitchspeed: f32,
21199 #[doc = "Yaw angular speed"]
21200 pub yawspeed: f32,
21201 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21202 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21203 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21204 pub pose_covariance: [f32; 21],
21205 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21206 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21207 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21208 pub velocity_covariance: [f32; 21],
21209 #[doc = "Coordinate frame of reference for the pose data."]
21210 pub frame_id: MavFrame,
21211 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21212 pub child_frame_id: MavFrame,
21213 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21214 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21215 pub reset_counter: u8,
21216 #[doc = "Type of estimator that is providing the odometry."]
21217 #[cfg_attr(feature = "serde", serde(default))]
21218 pub estimator_type: MavEstimatorType,
21219 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21220 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21221 pub quality: i8,
21222}
21223impl ODOMETRY_DATA {
21224 pub const ENCODED_LEN: usize = 233usize;
21225 pub const DEFAULT: Self = Self {
21226 time_usec: 0_u64,
21227 x: 0.0_f32,
21228 y: 0.0_f32,
21229 z: 0.0_f32,
21230 q: [0.0_f32; 4usize],
21231 vx: 0.0_f32,
21232 vy: 0.0_f32,
21233 vz: 0.0_f32,
21234 rollspeed: 0.0_f32,
21235 pitchspeed: 0.0_f32,
21236 yawspeed: 0.0_f32,
21237 pose_covariance: [0.0_f32; 21usize],
21238 velocity_covariance: [0.0_f32; 21usize],
21239 frame_id: MavFrame::DEFAULT,
21240 child_frame_id: MavFrame::DEFAULT,
21241 reset_counter: 0_u8,
21242 estimator_type: MavEstimatorType::DEFAULT,
21243 quality: 0_i8,
21244 };
21245 #[cfg(feature = "arbitrary")]
21246 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21247 use arbitrary::{Arbitrary, Unstructured};
21248 let mut buf = [0u8; 1024];
21249 rng.fill_bytes(&mut buf);
21250 let mut unstructured = Unstructured::new(&buf);
21251 Self::arbitrary(&mut unstructured).unwrap_or_default()
21252 }
21253}
21254impl Default for ODOMETRY_DATA {
21255 fn default() -> Self {
21256 Self::DEFAULT.clone()
21257 }
21258}
21259impl MessageData for ODOMETRY_DATA {
21260 type Message = MavMessage;
21261 const ID: u32 = 331u32;
21262 const NAME: &'static str = "ODOMETRY";
21263 const EXTRA_CRC: u8 = 91u8;
21264 const ENCODED_LEN: usize = 233usize;
21265 fn deser(
21266 _version: MavlinkVersion,
21267 __input: &[u8],
21268 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21269 let avail_len = __input.len();
21270 let mut payload_buf = [0; Self::ENCODED_LEN];
21271 let mut buf = if avail_len < Self::ENCODED_LEN {
21272 payload_buf[0..avail_len].copy_from_slice(__input);
21273 Bytes::new(&payload_buf)
21274 } else {
21275 Bytes::new(__input)
21276 };
21277 let mut __struct = Self::default();
21278 __struct.time_usec = buf.get_u64_le();
21279 __struct.x = buf.get_f32_le();
21280 __struct.y = buf.get_f32_le();
21281 __struct.z = buf.get_f32_le();
21282 for v in &mut __struct.q {
21283 let val = buf.get_f32_le();
21284 *v = val;
21285 }
21286 __struct.vx = buf.get_f32_le();
21287 __struct.vy = buf.get_f32_le();
21288 __struct.vz = buf.get_f32_le();
21289 __struct.rollspeed = buf.get_f32_le();
21290 __struct.pitchspeed = buf.get_f32_le();
21291 __struct.yawspeed = buf.get_f32_le();
21292 for v in &mut __struct.pose_covariance {
21293 let val = buf.get_f32_le();
21294 *v = val;
21295 }
21296 for v in &mut __struct.velocity_covariance {
21297 let val = buf.get_f32_le();
21298 *v = val;
21299 }
21300 let tmp = buf.get_u8();
21301 __struct.frame_id =
21302 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21303 enum_type: "MavFrame",
21304 value: tmp as u32,
21305 })?;
21306 let tmp = buf.get_u8();
21307 __struct.child_frame_id =
21308 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21309 enum_type: "MavFrame",
21310 value: tmp as u32,
21311 })?;
21312 __struct.reset_counter = buf.get_u8();
21313 let tmp = buf.get_u8();
21314 __struct.estimator_type =
21315 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21316 enum_type: "MavEstimatorType",
21317 value: tmp as u32,
21318 })?;
21319 __struct.quality = buf.get_i8();
21320 Ok(__struct)
21321 }
21322 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21323 let mut __tmp = BytesMut::new(bytes);
21324 #[allow(clippy::absurd_extreme_comparisons)]
21325 #[allow(unused_comparisons)]
21326 if __tmp.remaining() < Self::ENCODED_LEN {
21327 panic!(
21328 "buffer is too small (need {} bytes, but got {})",
21329 Self::ENCODED_LEN,
21330 __tmp.remaining(),
21331 )
21332 }
21333 __tmp.put_u64_le(self.time_usec);
21334 __tmp.put_f32_le(self.x);
21335 __tmp.put_f32_le(self.y);
21336 __tmp.put_f32_le(self.z);
21337 for val in &self.q {
21338 __tmp.put_f32_le(*val);
21339 }
21340 __tmp.put_f32_le(self.vx);
21341 __tmp.put_f32_le(self.vy);
21342 __tmp.put_f32_le(self.vz);
21343 __tmp.put_f32_le(self.rollspeed);
21344 __tmp.put_f32_le(self.pitchspeed);
21345 __tmp.put_f32_le(self.yawspeed);
21346 for val in &self.pose_covariance {
21347 __tmp.put_f32_le(*val);
21348 }
21349 for val in &self.velocity_covariance {
21350 __tmp.put_f32_le(*val);
21351 }
21352 __tmp.put_u8(self.frame_id as u8);
21353 __tmp.put_u8(self.child_frame_id as u8);
21354 if matches!(version, MavlinkVersion::V2) {
21355 __tmp.put_u8(self.reset_counter);
21356 __tmp.put_u8(self.estimator_type as u8);
21357 __tmp.put_i8(self.quality);
21358 let len = __tmp.len();
21359 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21360 } else {
21361 __tmp.len()
21362 }
21363 }
21364}
21365#[doc = "Hardware status sent by an onboard computer."]
21366#[doc = ""]
21367#[doc = "ID: 390"]
21368#[derive(Debug, Clone, PartialEq)]
21369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21371#[cfg_attr(feature = "ts", derive(TS))]
21372#[cfg_attr(feature = "ts", ts(export))]
21373pub struct ONBOARD_COMPUTER_STATUS_DATA {
21374 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21375 pub time_usec: u64,
21376 #[doc = "Time since system boot."]
21377 pub uptime: u32,
21378 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21379 pub ram_usage: u32,
21380 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21381 pub ram_total: u32,
21382 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21383 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21384 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21385 pub storage_type: [u32; 4],
21386 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21387 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21388 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21389 pub storage_usage: [u32; 4],
21390 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21391 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21392 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21393 pub storage_total: [u32; 4],
21394 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21395 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21396 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21397 pub link_type: [u32; 6],
21398 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21399 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21400 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21401 pub link_tx_rate: [u32; 6],
21402 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21403 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21404 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21405 pub link_rx_rate: [u32; 6],
21406 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21407 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21408 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21409 pub link_tx_max: [u32; 6],
21410 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21411 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21412 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21413 pub link_rx_max: [u32; 6],
21414 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21415 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21416 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21417 pub fan_speed: [i16; 4],
21418 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21419 pub mavtype: u8,
21420 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21421 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21422 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21423 pub cpu_cores: [u8; 8],
21424 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21425 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21426 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21427 pub cpu_combined: [u8; 10],
21428 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21429 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21430 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21431 pub gpu_cores: [u8; 4],
21432 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21433 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21434 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21435 pub gpu_combined: [u8; 10],
21436 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21437 pub temperature_board: i8,
21438 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21439 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21440 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21441 pub temperature_core: [i8; 8],
21442}
21443impl ONBOARD_COMPUTER_STATUS_DATA {
21444 pub const ENCODED_LEN: usize = 238usize;
21445 pub const DEFAULT: Self = Self {
21446 time_usec: 0_u64,
21447 uptime: 0_u32,
21448 ram_usage: 0_u32,
21449 ram_total: 0_u32,
21450 storage_type: [0_u32; 4usize],
21451 storage_usage: [0_u32; 4usize],
21452 storage_total: [0_u32; 4usize],
21453 link_type: [0_u32; 6usize],
21454 link_tx_rate: [0_u32; 6usize],
21455 link_rx_rate: [0_u32; 6usize],
21456 link_tx_max: [0_u32; 6usize],
21457 link_rx_max: [0_u32; 6usize],
21458 fan_speed: [0_i16; 4usize],
21459 mavtype: 0_u8,
21460 cpu_cores: [0_u8; 8usize],
21461 cpu_combined: [0_u8; 10usize],
21462 gpu_cores: [0_u8; 4usize],
21463 gpu_combined: [0_u8; 10usize],
21464 temperature_board: 0_i8,
21465 temperature_core: [0_i8; 8usize],
21466 };
21467 #[cfg(feature = "arbitrary")]
21468 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21469 use arbitrary::{Arbitrary, Unstructured};
21470 let mut buf = [0u8; 1024];
21471 rng.fill_bytes(&mut buf);
21472 let mut unstructured = Unstructured::new(&buf);
21473 Self::arbitrary(&mut unstructured).unwrap_or_default()
21474 }
21475}
21476impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21477 fn default() -> Self {
21478 Self::DEFAULT.clone()
21479 }
21480}
21481impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21482 type Message = MavMessage;
21483 const ID: u32 = 390u32;
21484 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21485 const EXTRA_CRC: u8 = 156u8;
21486 const ENCODED_LEN: usize = 238usize;
21487 fn deser(
21488 _version: MavlinkVersion,
21489 __input: &[u8],
21490 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21491 let avail_len = __input.len();
21492 let mut payload_buf = [0; Self::ENCODED_LEN];
21493 let mut buf = if avail_len < Self::ENCODED_LEN {
21494 payload_buf[0..avail_len].copy_from_slice(__input);
21495 Bytes::new(&payload_buf)
21496 } else {
21497 Bytes::new(__input)
21498 };
21499 let mut __struct = Self::default();
21500 __struct.time_usec = buf.get_u64_le();
21501 __struct.uptime = buf.get_u32_le();
21502 __struct.ram_usage = buf.get_u32_le();
21503 __struct.ram_total = buf.get_u32_le();
21504 for v in &mut __struct.storage_type {
21505 let val = buf.get_u32_le();
21506 *v = val;
21507 }
21508 for v in &mut __struct.storage_usage {
21509 let val = buf.get_u32_le();
21510 *v = val;
21511 }
21512 for v in &mut __struct.storage_total {
21513 let val = buf.get_u32_le();
21514 *v = val;
21515 }
21516 for v in &mut __struct.link_type {
21517 let val = buf.get_u32_le();
21518 *v = val;
21519 }
21520 for v in &mut __struct.link_tx_rate {
21521 let val = buf.get_u32_le();
21522 *v = val;
21523 }
21524 for v in &mut __struct.link_rx_rate {
21525 let val = buf.get_u32_le();
21526 *v = val;
21527 }
21528 for v in &mut __struct.link_tx_max {
21529 let val = buf.get_u32_le();
21530 *v = val;
21531 }
21532 for v in &mut __struct.link_rx_max {
21533 let val = buf.get_u32_le();
21534 *v = val;
21535 }
21536 for v in &mut __struct.fan_speed {
21537 let val = buf.get_i16_le();
21538 *v = val;
21539 }
21540 __struct.mavtype = buf.get_u8();
21541 for v in &mut __struct.cpu_cores {
21542 let val = buf.get_u8();
21543 *v = val;
21544 }
21545 for v in &mut __struct.cpu_combined {
21546 let val = buf.get_u8();
21547 *v = val;
21548 }
21549 for v in &mut __struct.gpu_cores {
21550 let val = buf.get_u8();
21551 *v = val;
21552 }
21553 for v in &mut __struct.gpu_combined {
21554 let val = buf.get_u8();
21555 *v = val;
21556 }
21557 __struct.temperature_board = buf.get_i8();
21558 for v in &mut __struct.temperature_core {
21559 let val = buf.get_i8();
21560 *v = val;
21561 }
21562 Ok(__struct)
21563 }
21564 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21565 let mut __tmp = BytesMut::new(bytes);
21566 #[allow(clippy::absurd_extreme_comparisons)]
21567 #[allow(unused_comparisons)]
21568 if __tmp.remaining() < Self::ENCODED_LEN {
21569 panic!(
21570 "buffer is too small (need {} bytes, but got {})",
21571 Self::ENCODED_LEN,
21572 __tmp.remaining(),
21573 )
21574 }
21575 __tmp.put_u64_le(self.time_usec);
21576 __tmp.put_u32_le(self.uptime);
21577 __tmp.put_u32_le(self.ram_usage);
21578 __tmp.put_u32_le(self.ram_total);
21579 for val in &self.storage_type {
21580 __tmp.put_u32_le(*val);
21581 }
21582 for val in &self.storage_usage {
21583 __tmp.put_u32_le(*val);
21584 }
21585 for val in &self.storage_total {
21586 __tmp.put_u32_le(*val);
21587 }
21588 for val in &self.link_type {
21589 __tmp.put_u32_le(*val);
21590 }
21591 for val in &self.link_tx_rate {
21592 __tmp.put_u32_le(*val);
21593 }
21594 for val in &self.link_rx_rate {
21595 __tmp.put_u32_le(*val);
21596 }
21597 for val in &self.link_tx_max {
21598 __tmp.put_u32_le(*val);
21599 }
21600 for val in &self.link_rx_max {
21601 __tmp.put_u32_le(*val);
21602 }
21603 for val in &self.fan_speed {
21604 __tmp.put_i16_le(*val);
21605 }
21606 __tmp.put_u8(self.mavtype);
21607 for val in &self.cpu_cores {
21608 __tmp.put_u8(*val);
21609 }
21610 for val in &self.cpu_combined {
21611 __tmp.put_u8(*val);
21612 }
21613 for val in &self.gpu_cores {
21614 __tmp.put_u8(*val);
21615 }
21616 for val in &self.gpu_combined {
21617 __tmp.put_u8(*val);
21618 }
21619 __tmp.put_i8(self.temperature_board);
21620 for val in &self.temperature_core {
21621 __tmp.put_i8(*val);
21622 }
21623 if matches!(version, MavlinkVersion::V2) {
21624 let len = __tmp.len();
21625 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21626 } else {
21627 __tmp.len()
21628 }
21629 }
21630}
21631#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21632#[doc = ""]
21633#[doc = "ID: 12918"]
21634#[derive(Debug, Clone, PartialEq)]
21635#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21637#[cfg_attr(feature = "ts", derive(TS))]
21638#[cfg_attr(feature = "ts", ts(export))]
21639pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21640 #[doc = "Status level indicating if arming is allowed."]
21641 pub status: MavOdidArmStatus,
21642 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21643 #[cfg_attr(
21644 feature = "serde",
21645 serde(
21646 serialize_with = "crate::nulstr::serialize::<_, 50>",
21647 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
21648 )
21649 )]
21650 #[cfg_attr(feature = "ts", ts(type = "string"))]
21651 pub error: [u8; 50],
21652}
21653impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21654 pub const ENCODED_LEN: usize = 51usize;
21655 pub const DEFAULT: Self = Self {
21656 status: MavOdidArmStatus::DEFAULT,
21657 error: [0_u8; 50usize],
21658 };
21659 #[cfg(feature = "arbitrary")]
21660 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21661 use arbitrary::{Arbitrary, Unstructured};
21662 let mut buf = [0u8; 1024];
21663 rng.fill_bytes(&mut buf);
21664 let mut unstructured = Unstructured::new(&buf);
21665 Self::arbitrary(&mut unstructured).unwrap_or_default()
21666 }
21667}
21668impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21669 fn default() -> Self {
21670 Self::DEFAULT.clone()
21671 }
21672}
21673impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21674 type Message = MavMessage;
21675 const ID: u32 = 12918u32;
21676 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21677 const EXTRA_CRC: u8 = 139u8;
21678 const ENCODED_LEN: usize = 51usize;
21679 fn deser(
21680 _version: MavlinkVersion,
21681 __input: &[u8],
21682 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21683 let avail_len = __input.len();
21684 let mut payload_buf = [0; Self::ENCODED_LEN];
21685 let mut buf = if avail_len < Self::ENCODED_LEN {
21686 payload_buf[0..avail_len].copy_from_slice(__input);
21687 Bytes::new(&payload_buf)
21688 } else {
21689 Bytes::new(__input)
21690 };
21691 let mut __struct = Self::default();
21692 let tmp = buf.get_u8();
21693 __struct.status =
21694 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21695 enum_type: "MavOdidArmStatus",
21696 value: tmp as u32,
21697 })?;
21698 for v in &mut __struct.error {
21699 let val = buf.get_u8();
21700 *v = val;
21701 }
21702 Ok(__struct)
21703 }
21704 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21705 let mut __tmp = BytesMut::new(bytes);
21706 #[allow(clippy::absurd_extreme_comparisons)]
21707 #[allow(unused_comparisons)]
21708 if __tmp.remaining() < Self::ENCODED_LEN {
21709 panic!(
21710 "buffer is too small (need {} bytes, but got {})",
21711 Self::ENCODED_LEN,
21712 __tmp.remaining(),
21713 )
21714 }
21715 __tmp.put_u8(self.status as u8);
21716 for val in &self.error {
21717 __tmp.put_u8(*val);
21718 }
21719 if matches!(version, MavlinkVersion::V2) {
21720 let len = __tmp.len();
21721 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21722 } else {
21723 __tmp.len()
21724 }
21725 }
21726}
21727#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21728#[doc = ""]
21729#[doc = "ID: 12902"]
21730#[derive(Debug, Clone, PartialEq)]
21731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21733#[cfg_attr(feature = "ts", derive(TS))]
21734#[cfg_attr(feature = "ts", ts(export))]
21735pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21736 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21737 pub timestamp: u32,
21738 #[doc = "System ID (0 for broadcast)."]
21739 pub target_system: u8,
21740 #[doc = "Component ID (0 for broadcast)."]
21741 pub target_component: u8,
21742 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21743 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21744 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21745 pub id_or_mac: [u8; 20],
21746 #[doc = "Indicates the type of authentication."]
21747 pub authentication_type: MavOdidAuthType,
21748 #[doc = "Allowed range is 0 - 15."]
21749 pub data_page: u8,
21750 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21751 pub last_page_index: u8,
21752 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21753 pub length: u8,
21754 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21755 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21756 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21757 pub authentication_data: [u8; 23],
21758}
21759impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21760 pub const ENCODED_LEN: usize = 53usize;
21761 pub const DEFAULT: Self = Self {
21762 timestamp: 0_u32,
21763 target_system: 0_u8,
21764 target_component: 0_u8,
21765 id_or_mac: [0_u8; 20usize],
21766 authentication_type: MavOdidAuthType::DEFAULT,
21767 data_page: 0_u8,
21768 last_page_index: 0_u8,
21769 length: 0_u8,
21770 authentication_data: [0_u8; 23usize],
21771 };
21772 #[cfg(feature = "arbitrary")]
21773 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21774 use arbitrary::{Arbitrary, Unstructured};
21775 let mut buf = [0u8; 1024];
21776 rng.fill_bytes(&mut buf);
21777 let mut unstructured = Unstructured::new(&buf);
21778 Self::arbitrary(&mut unstructured).unwrap_or_default()
21779 }
21780}
21781impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21782 fn default() -> Self {
21783 Self::DEFAULT.clone()
21784 }
21785}
21786impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21787 type Message = MavMessage;
21788 const ID: u32 = 12902u32;
21789 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21790 const EXTRA_CRC: u8 = 140u8;
21791 const ENCODED_LEN: usize = 53usize;
21792 fn deser(
21793 _version: MavlinkVersion,
21794 __input: &[u8],
21795 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21796 let avail_len = __input.len();
21797 let mut payload_buf = [0; Self::ENCODED_LEN];
21798 let mut buf = if avail_len < Self::ENCODED_LEN {
21799 payload_buf[0..avail_len].copy_from_slice(__input);
21800 Bytes::new(&payload_buf)
21801 } else {
21802 Bytes::new(__input)
21803 };
21804 let mut __struct = Self::default();
21805 __struct.timestamp = buf.get_u32_le();
21806 __struct.target_system = buf.get_u8();
21807 __struct.target_component = buf.get_u8();
21808 for v in &mut __struct.id_or_mac {
21809 let val = buf.get_u8();
21810 *v = val;
21811 }
21812 let tmp = buf.get_u8();
21813 __struct.authentication_type =
21814 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21815 enum_type: "MavOdidAuthType",
21816 value: tmp as u32,
21817 })?;
21818 __struct.data_page = buf.get_u8();
21819 __struct.last_page_index = buf.get_u8();
21820 __struct.length = buf.get_u8();
21821 for v in &mut __struct.authentication_data {
21822 let val = buf.get_u8();
21823 *v = val;
21824 }
21825 Ok(__struct)
21826 }
21827 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21828 let mut __tmp = BytesMut::new(bytes);
21829 #[allow(clippy::absurd_extreme_comparisons)]
21830 #[allow(unused_comparisons)]
21831 if __tmp.remaining() < Self::ENCODED_LEN {
21832 panic!(
21833 "buffer is too small (need {} bytes, but got {})",
21834 Self::ENCODED_LEN,
21835 __tmp.remaining(),
21836 )
21837 }
21838 __tmp.put_u32_le(self.timestamp);
21839 __tmp.put_u8(self.target_system);
21840 __tmp.put_u8(self.target_component);
21841 for val in &self.id_or_mac {
21842 __tmp.put_u8(*val);
21843 }
21844 __tmp.put_u8(self.authentication_type as u8);
21845 __tmp.put_u8(self.data_page);
21846 __tmp.put_u8(self.last_page_index);
21847 __tmp.put_u8(self.length);
21848 for val in &self.authentication_data {
21849 __tmp.put_u8(*val);
21850 }
21851 if matches!(version, MavlinkVersion::V2) {
21852 let len = __tmp.len();
21853 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21854 } else {
21855 __tmp.len()
21856 }
21857 }
21858}
21859#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21860#[doc = ""]
21861#[doc = "ID: 12900"]
21862#[derive(Debug, Clone, PartialEq)]
21863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21865#[cfg_attr(feature = "ts", derive(TS))]
21866#[cfg_attr(feature = "ts", ts(export))]
21867pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21868 #[doc = "System ID (0 for broadcast)."]
21869 pub target_system: u8,
21870 #[doc = "Component ID (0 for broadcast)."]
21871 pub target_component: u8,
21872 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21873 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21874 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21875 pub id_or_mac: [u8; 20],
21876 #[doc = "Indicates the format for the uas_id field of this message."]
21877 pub id_type: MavOdidIdType,
21878 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21879 pub ua_type: MavOdidUaType,
21880 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21881 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21882 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21883 pub uas_id: [u8; 20],
21884}
21885impl OPEN_DRONE_ID_BASIC_ID_DATA {
21886 pub const ENCODED_LEN: usize = 44usize;
21887 pub const DEFAULT: Self = Self {
21888 target_system: 0_u8,
21889 target_component: 0_u8,
21890 id_or_mac: [0_u8; 20usize],
21891 id_type: MavOdidIdType::DEFAULT,
21892 ua_type: MavOdidUaType::DEFAULT,
21893 uas_id: [0_u8; 20usize],
21894 };
21895 #[cfg(feature = "arbitrary")]
21896 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21897 use arbitrary::{Arbitrary, Unstructured};
21898 let mut buf = [0u8; 1024];
21899 rng.fill_bytes(&mut buf);
21900 let mut unstructured = Unstructured::new(&buf);
21901 Self::arbitrary(&mut unstructured).unwrap_or_default()
21902 }
21903}
21904impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21905 fn default() -> Self {
21906 Self::DEFAULT.clone()
21907 }
21908}
21909impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21910 type Message = MavMessage;
21911 const ID: u32 = 12900u32;
21912 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21913 const EXTRA_CRC: u8 = 114u8;
21914 const ENCODED_LEN: usize = 44usize;
21915 fn deser(
21916 _version: MavlinkVersion,
21917 __input: &[u8],
21918 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21919 let avail_len = __input.len();
21920 let mut payload_buf = [0; Self::ENCODED_LEN];
21921 let mut buf = if avail_len < Self::ENCODED_LEN {
21922 payload_buf[0..avail_len].copy_from_slice(__input);
21923 Bytes::new(&payload_buf)
21924 } else {
21925 Bytes::new(__input)
21926 };
21927 let mut __struct = Self::default();
21928 __struct.target_system = buf.get_u8();
21929 __struct.target_component = buf.get_u8();
21930 for v in &mut __struct.id_or_mac {
21931 let val = buf.get_u8();
21932 *v = val;
21933 }
21934 let tmp = buf.get_u8();
21935 __struct.id_type =
21936 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21937 enum_type: "MavOdidIdType",
21938 value: tmp as u32,
21939 })?;
21940 let tmp = buf.get_u8();
21941 __struct.ua_type =
21942 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21943 enum_type: "MavOdidUaType",
21944 value: tmp as u32,
21945 })?;
21946 for v in &mut __struct.uas_id {
21947 let val = buf.get_u8();
21948 *v = val;
21949 }
21950 Ok(__struct)
21951 }
21952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21953 let mut __tmp = BytesMut::new(bytes);
21954 #[allow(clippy::absurd_extreme_comparisons)]
21955 #[allow(unused_comparisons)]
21956 if __tmp.remaining() < Self::ENCODED_LEN {
21957 panic!(
21958 "buffer is too small (need {} bytes, but got {})",
21959 Self::ENCODED_LEN,
21960 __tmp.remaining(),
21961 )
21962 }
21963 __tmp.put_u8(self.target_system);
21964 __tmp.put_u8(self.target_component);
21965 for val in &self.id_or_mac {
21966 __tmp.put_u8(*val);
21967 }
21968 __tmp.put_u8(self.id_type as u8);
21969 __tmp.put_u8(self.ua_type as u8);
21970 for val in &self.uas_id {
21971 __tmp.put_u8(*val);
21972 }
21973 if matches!(version, MavlinkVersion::V2) {
21974 let len = __tmp.len();
21975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21976 } else {
21977 __tmp.len()
21978 }
21979 }
21980}
21981#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21982#[doc = ""]
21983#[doc = "ID: 12901"]
21984#[derive(Debug, Clone, PartialEq)]
21985#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21987#[cfg_attr(feature = "ts", derive(TS))]
21988#[cfg_attr(feature = "ts", ts(export))]
21989pub struct OPEN_DRONE_ID_LOCATION_DATA {
21990 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21991 pub latitude: i32,
21992 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21993 pub longitude: i32,
21994 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21995 pub altitude_barometric: f32,
21996 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21997 pub altitude_geodetic: f32,
21998 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21999 pub height: f32,
22000 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22001 pub timestamp: f32,
22002 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22003 pub direction: u16,
22004 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22005 pub speed_horizontal: u16,
22006 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22007 pub speed_vertical: i16,
22008 #[doc = "System ID (0 for broadcast)."]
22009 pub target_system: u8,
22010 #[doc = "Component ID (0 for broadcast)."]
22011 pub target_component: u8,
22012 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22013 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22014 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22015 pub id_or_mac: [u8; 20],
22016 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22017 pub status: MavOdidStatus,
22018 #[doc = "Indicates the reference point for the height field."]
22019 pub height_reference: MavOdidHeightRef,
22020 #[doc = "The accuracy of the horizontal position."]
22021 pub horizontal_accuracy: MavOdidHorAcc,
22022 #[doc = "The accuracy of the vertical position."]
22023 pub vertical_accuracy: MavOdidVerAcc,
22024 #[doc = "The accuracy of the barometric altitude."]
22025 pub barometer_accuracy: MavOdidVerAcc,
22026 #[doc = "The accuracy of the horizontal and vertical speed."]
22027 pub speed_accuracy: MavOdidSpeedAcc,
22028 #[doc = "The accuracy of the timestamps."]
22029 pub timestamp_accuracy: MavOdidTimeAcc,
22030}
22031impl OPEN_DRONE_ID_LOCATION_DATA {
22032 pub const ENCODED_LEN: usize = 59usize;
22033 pub const DEFAULT: Self = Self {
22034 latitude: 0_i32,
22035 longitude: 0_i32,
22036 altitude_barometric: 0.0_f32,
22037 altitude_geodetic: 0.0_f32,
22038 height: 0.0_f32,
22039 timestamp: 0.0_f32,
22040 direction: 0_u16,
22041 speed_horizontal: 0_u16,
22042 speed_vertical: 0_i16,
22043 target_system: 0_u8,
22044 target_component: 0_u8,
22045 id_or_mac: [0_u8; 20usize],
22046 status: MavOdidStatus::DEFAULT,
22047 height_reference: MavOdidHeightRef::DEFAULT,
22048 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22049 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22050 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22051 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22052 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22053 };
22054 #[cfg(feature = "arbitrary")]
22055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22056 use arbitrary::{Arbitrary, Unstructured};
22057 let mut buf = [0u8; 1024];
22058 rng.fill_bytes(&mut buf);
22059 let mut unstructured = Unstructured::new(&buf);
22060 Self::arbitrary(&mut unstructured).unwrap_or_default()
22061 }
22062}
22063impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22064 fn default() -> Self {
22065 Self::DEFAULT.clone()
22066 }
22067}
22068impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22069 type Message = MavMessage;
22070 const ID: u32 = 12901u32;
22071 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22072 const EXTRA_CRC: u8 = 254u8;
22073 const ENCODED_LEN: usize = 59usize;
22074 fn deser(
22075 _version: MavlinkVersion,
22076 __input: &[u8],
22077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22078 let avail_len = __input.len();
22079 let mut payload_buf = [0; Self::ENCODED_LEN];
22080 let mut buf = if avail_len < Self::ENCODED_LEN {
22081 payload_buf[0..avail_len].copy_from_slice(__input);
22082 Bytes::new(&payload_buf)
22083 } else {
22084 Bytes::new(__input)
22085 };
22086 let mut __struct = Self::default();
22087 __struct.latitude = buf.get_i32_le();
22088 __struct.longitude = buf.get_i32_le();
22089 __struct.altitude_barometric = buf.get_f32_le();
22090 __struct.altitude_geodetic = buf.get_f32_le();
22091 __struct.height = buf.get_f32_le();
22092 __struct.timestamp = buf.get_f32_le();
22093 __struct.direction = buf.get_u16_le();
22094 __struct.speed_horizontal = buf.get_u16_le();
22095 __struct.speed_vertical = buf.get_i16_le();
22096 __struct.target_system = buf.get_u8();
22097 __struct.target_component = buf.get_u8();
22098 for v in &mut __struct.id_or_mac {
22099 let val = buf.get_u8();
22100 *v = val;
22101 }
22102 let tmp = buf.get_u8();
22103 __struct.status =
22104 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22105 enum_type: "MavOdidStatus",
22106 value: tmp as u32,
22107 })?;
22108 let tmp = buf.get_u8();
22109 __struct.height_reference =
22110 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22111 enum_type: "MavOdidHeightRef",
22112 value: tmp as u32,
22113 })?;
22114 let tmp = buf.get_u8();
22115 __struct.horizontal_accuracy =
22116 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22117 enum_type: "MavOdidHorAcc",
22118 value: tmp as u32,
22119 })?;
22120 let tmp = buf.get_u8();
22121 __struct.vertical_accuracy =
22122 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22123 enum_type: "MavOdidVerAcc",
22124 value: tmp as u32,
22125 })?;
22126 let tmp = buf.get_u8();
22127 __struct.barometer_accuracy =
22128 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22129 enum_type: "MavOdidVerAcc",
22130 value: tmp as u32,
22131 })?;
22132 let tmp = buf.get_u8();
22133 __struct.speed_accuracy =
22134 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22135 enum_type: "MavOdidSpeedAcc",
22136 value: tmp as u32,
22137 })?;
22138 let tmp = buf.get_u8();
22139 __struct.timestamp_accuracy =
22140 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22141 enum_type: "MavOdidTimeAcc",
22142 value: tmp as u32,
22143 })?;
22144 Ok(__struct)
22145 }
22146 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22147 let mut __tmp = BytesMut::new(bytes);
22148 #[allow(clippy::absurd_extreme_comparisons)]
22149 #[allow(unused_comparisons)]
22150 if __tmp.remaining() < Self::ENCODED_LEN {
22151 panic!(
22152 "buffer is too small (need {} bytes, but got {})",
22153 Self::ENCODED_LEN,
22154 __tmp.remaining(),
22155 )
22156 }
22157 __tmp.put_i32_le(self.latitude);
22158 __tmp.put_i32_le(self.longitude);
22159 __tmp.put_f32_le(self.altitude_barometric);
22160 __tmp.put_f32_le(self.altitude_geodetic);
22161 __tmp.put_f32_le(self.height);
22162 __tmp.put_f32_le(self.timestamp);
22163 __tmp.put_u16_le(self.direction);
22164 __tmp.put_u16_le(self.speed_horizontal);
22165 __tmp.put_i16_le(self.speed_vertical);
22166 __tmp.put_u8(self.target_system);
22167 __tmp.put_u8(self.target_component);
22168 for val in &self.id_or_mac {
22169 __tmp.put_u8(*val);
22170 }
22171 __tmp.put_u8(self.status as u8);
22172 __tmp.put_u8(self.height_reference as u8);
22173 __tmp.put_u8(self.horizontal_accuracy as u8);
22174 __tmp.put_u8(self.vertical_accuracy as u8);
22175 __tmp.put_u8(self.barometer_accuracy as u8);
22176 __tmp.put_u8(self.speed_accuracy as u8);
22177 __tmp.put_u8(self.timestamp_accuracy as u8);
22178 if matches!(version, MavlinkVersion::V2) {
22179 let len = __tmp.len();
22180 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22181 } else {
22182 __tmp.len()
22183 }
22184 }
22185}
22186#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22187#[doc = ""]
22188#[doc = "ID: 12915"]
22189#[derive(Debug, Clone, PartialEq)]
22190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22192#[cfg_attr(feature = "ts", derive(TS))]
22193#[cfg_attr(feature = "ts", ts(export))]
22194pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22195 #[doc = "System ID (0 for broadcast)."]
22196 pub target_system: u8,
22197 #[doc = "Component ID (0 for broadcast)."]
22198 pub target_component: u8,
22199 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22200 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22201 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22202 pub id_or_mac: [u8; 20],
22203 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22204 pub single_message_size: u8,
22205 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22206 pub msg_pack_size: u8,
22207 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22208 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22209 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22210 pub messages: [u8; 225],
22211}
22212impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22213 pub const ENCODED_LEN: usize = 249usize;
22214 pub const DEFAULT: Self = Self {
22215 target_system: 0_u8,
22216 target_component: 0_u8,
22217 id_or_mac: [0_u8; 20usize],
22218 single_message_size: 0_u8,
22219 msg_pack_size: 0_u8,
22220 messages: [0_u8; 225usize],
22221 };
22222 #[cfg(feature = "arbitrary")]
22223 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22224 use arbitrary::{Arbitrary, Unstructured};
22225 let mut buf = [0u8; 1024];
22226 rng.fill_bytes(&mut buf);
22227 let mut unstructured = Unstructured::new(&buf);
22228 Self::arbitrary(&mut unstructured).unwrap_or_default()
22229 }
22230}
22231impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22232 fn default() -> Self {
22233 Self::DEFAULT.clone()
22234 }
22235}
22236impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22237 type Message = MavMessage;
22238 const ID: u32 = 12915u32;
22239 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22240 const EXTRA_CRC: u8 = 94u8;
22241 const ENCODED_LEN: usize = 249usize;
22242 fn deser(
22243 _version: MavlinkVersion,
22244 __input: &[u8],
22245 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22246 let avail_len = __input.len();
22247 let mut payload_buf = [0; Self::ENCODED_LEN];
22248 let mut buf = if avail_len < Self::ENCODED_LEN {
22249 payload_buf[0..avail_len].copy_from_slice(__input);
22250 Bytes::new(&payload_buf)
22251 } else {
22252 Bytes::new(__input)
22253 };
22254 let mut __struct = Self::default();
22255 __struct.target_system = buf.get_u8();
22256 __struct.target_component = buf.get_u8();
22257 for v in &mut __struct.id_or_mac {
22258 let val = buf.get_u8();
22259 *v = val;
22260 }
22261 __struct.single_message_size = buf.get_u8();
22262 __struct.msg_pack_size = buf.get_u8();
22263 for v in &mut __struct.messages {
22264 let val = buf.get_u8();
22265 *v = val;
22266 }
22267 Ok(__struct)
22268 }
22269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22270 let mut __tmp = BytesMut::new(bytes);
22271 #[allow(clippy::absurd_extreme_comparisons)]
22272 #[allow(unused_comparisons)]
22273 if __tmp.remaining() < Self::ENCODED_LEN {
22274 panic!(
22275 "buffer is too small (need {} bytes, but got {})",
22276 Self::ENCODED_LEN,
22277 __tmp.remaining(),
22278 )
22279 }
22280 __tmp.put_u8(self.target_system);
22281 __tmp.put_u8(self.target_component);
22282 for val in &self.id_or_mac {
22283 __tmp.put_u8(*val);
22284 }
22285 __tmp.put_u8(self.single_message_size);
22286 __tmp.put_u8(self.msg_pack_size);
22287 for val in &self.messages {
22288 __tmp.put_u8(*val);
22289 }
22290 if matches!(version, MavlinkVersion::V2) {
22291 let len = __tmp.len();
22292 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22293 } else {
22294 __tmp.len()
22295 }
22296 }
22297}
22298#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22299#[doc = ""]
22300#[doc = "ID: 12905"]
22301#[derive(Debug, Clone, PartialEq)]
22302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22304#[cfg_attr(feature = "ts", derive(TS))]
22305#[cfg_attr(feature = "ts", ts(export))]
22306pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22307 #[doc = "System ID (0 for broadcast)."]
22308 pub target_system: u8,
22309 #[doc = "Component ID (0 for broadcast)."]
22310 pub target_component: u8,
22311 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22312 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22313 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22314 pub id_or_mac: [u8; 20],
22315 #[doc = "Indicates the type of the operator_id field."]
22316 pub operator_id_type: MavOdidOperatorIdType,
22317 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22318 #[cfg_attr(
22319 feature = "serde",
22320 serde(
22321 serialize_with = "crate::nulstr::serialize::<_, 20>",
22322 deserialize_with = "crate::nulstr::deserialize::<_, 20>"
22323 )
22324 )]
22325 #[cfg_attr(feature = "ts", ts(type = "string"))]
22326 pub operator_id: [u8; 20],
22327}
22328impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22329 pub const ENCODED_LEN: usize = 43usize;
22330 pub const DEFAULT: Self = Self {
22331 target_system: 0_u8,
22332 target_component: 0_u8,
22333 id_or_mac: [0_u8; 20usize],
22334 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22335 operator_id: [0_u8; 20usize],
22336 };
22337 #[cfg(feature = "arbitrary")]
22338 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22339 use arbitrary::{Arbitrary, Unstructured};
22340 let mut buf = [0u8; 1024];
22341 rng.fill_bytes(&mut buf);
22342 let mut unstructured = Unstructured::new(&buf);
22343 Self::arbitrary(&mut unstructured).unwrap_or_default()
22344 }
22345}
22346impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22347 fn default() -> Self {
22348 Self::DEFAULT.clone()
22349 }
22350}
22351impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22352 type Message = MavMessage;
22353 const ID: u32 = 12905u32;
22354 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22355 const EXTRA_CRC: u8 = 49u8;
22356 const ENCODED_LEN: usize = 43usize;
22357 fn deser(
22358 _version: MavlinkVersion,
22359 __input: &[u8],
22360 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22361 let avail_len = __input.len();
22362 let mut payload_buf = [0; Self::ENCODED_LEN];
22363 let mut buf = if avail_len < Self::ENCODED_LEN {
22364 payload_buf[0..avail_len].copy_from_slice(__input);
22365 Bytes::new(&payload_buf)
22366 } else {
22367 Bytes::new(__input)
22368 };
22369 let mut __struct = Self::default();
22370 __struct.target_system = buf.get_u8();
22371 __struct.target_component = buf.get_u8();
22372 for v in &mut __struct.id_or_mac {
22373 let val = buf.get_u8();
22374 *v = val;
22375 }
22376 let tmp = buf.get_u8();
22377 __struct.operator_id_type =
22378 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22379 enum_type: "MavOdidOperatorIdType",
22380 value: tmp as u32,
22381 })?;
22382 for v in &mut __struct.operator_id {
22383 let val = buf.get_u8();
22384 *v = val;
22385 }
22386 Ok(__struct)
22387 }
22388 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22389 let mut __tmp = BytesMut::new(bytes);
22390 #[allow(clippy::absurd_extreme_comparisons)]
22391 #[allow(unused_comparisons)]
22392 if __tmp.remaining() < Self::ENCODED_LEN {
22393 panic!(
22394 "buffer is too small (need {} bytes, but got {})",
22395 Self::ENCODED_LEN,
22396 __tmp.remaining(),
22397 )
22398 }
22399 __tmp.put_u8(self.target_system);
22400 __tmp.put_u8(self.target_component);
22401 for val in &self.id_or_mac {
22402 __tmp.put_u8(*val);
22403 }
22404 __tmp.put_u8(self.operator_id_type as u8);
22405 for val in &self.operator_id {
22406 __tmp.put_u8(*val);
22407 }
22408 if matches!(version, MavlinkVersion::V2) {
22409 let len = __tmp.len();
22410 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22411 } else {
22412 __tmp.len()
22413 }
22414 }
22415}
22416#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22417#[doc = ""]
22418#[doc = "ID: 12903"]
22419#[derive(Debug, Clone, PartialEq)]
22420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22422#[cfg_attr(feature = "ts", derive(TS))]
22423#[cfg_attr(feature = "ts", ts(export))]
22424pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22425 #[doc = "System ID (0 for broadcast)."]
22426 pub target_system: u8,
22427 #[doc = "Component ID (0 for broadcast)."]
22428 pub target_component: u8,
22429 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22430 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22431 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22432 pub id_or_mac: [u8; 20],
22433 #[doc = "Indicates the type of the description field."]
22434 pub description_type: MavOdidDescType,
22435 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22436 #[cfg_attr(
22437 feature = "serde",
22438 serde(
22439 serialize_with = "crate::nulstr::serialize::<_, 23>",
22440 deserialize_with = "crate::nulstr::deserialize::<_, 23>"
22441 )
22442 )]
22443 #[cfg_attr(feature = "ts", ts(type = "string"))]
22444 pub description: [u8; 23],
22445}
22446impl OPEN_DRONE_ID_SELF_ID_DATA {
22447 pub const ENCODED_LEN: usize = 46usize;
22448 pub const DEFAULT: Self = Self {
22449 target_system: 0_u8,
22450 target_component: 0_u8,
22451 id_or_mac: [0_u8; 20usize],
22452 description_type: MavOdidDescType::DEFAULT,
22453 description: [0_u8; 23usize],
22454 };
22455 #[cfg(feature = "arbitrary")]
22456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22457 use arbitrary::{Arbitrary, Unstructured};
22458 let mut buf = [0u8; 1024];
22459 rng.fill_bytes(&mut buf);
22460 let mut unstructured = Unstructured::new(&buf);
22461 Self::arbitrary(&mut unstructured).unwrap_or_default()
22462 }
22463}
22464impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22465 fn default() -> Self {
22466 Self::DEFAULT.clone()
22467 }
22468}
22469impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22470 type Message = MavMessage;
22471 const ID: u32 = 12903u32;
22472 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22473 const EXTRA_CRC: u8 = 249u8;
22474 const ENCODED_LEN: usize = 46usize;
22475 fn deser(
22476 _version: MavlinkVersion,
22477 __input: &[u8],
22478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22479 let avail_len = __input.len();
22480 let mut payload_buf = [0; Self::ENCODED_LEN];
22481 let mut buf = if avail_len < Self::ENCODED_LEN {
22482 payload_buf[0..avail_len].copy_from_slice(__input);
22483 Bytes::new(&payload_buf)
22484 } else {
22485 Bytes::new(__input)
22486 };
22487 let mut __struct = Self::default();
22488 __struct.target_system = buf.get_u8();
22489 __struct.target_component = buf.get_u8();
22490 for v in &mut __struct.id_or_mac {
22491 let val = buf.get_u8();
22492 *v = val;
22493 }
22494 let tmp = buf.get_u8();
22495 __struct.description_type =
22496 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22497 enum_type: "MavOdidDescType",
22498 value: tmp as u32,
22499 })?;
22500 for v in &mut __struct.description {
22501 let val = buf.get_u8();
22502 *v = val;
22503 }
22504 Ok(__struct)
22505 }
22506 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22507 let mut __tmp = BytesMut::new(bytes);
22508 #[allow(clippy::absurd_extreme_comparisons)]
22509 #[allow(unused_comparisons)]
22510 if __tmp.remaining() < Self::ENCODED_LEN {
22511 panic!(
22512 "buffer is too small (need {} bytes, but got {})",
22513 Self::ENCODED_LEN,
22514 __tmp.remaining(),
22515 )
22516 }
22517 __tmp.put_u8(self.target_system);
22518 __tmp.put_u8(self.target_component);
22519 for val in &self.id_or_mac {
22520 __tmp.put_u8(*val);
22521 }
22522 __tmp.put_u8(self.description_type as u8);
22523 for val in &self.description {
22524 __tmp.put_u8(*val);
22525 }
22526 if matches!(version, MavlinkVersion::V2) {
22527 let len = __tmp.len();
22528 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22529 } else {
22530 __tmp.len()
22531 }
22532 }
22533}
22534#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22535#[doc = ""]
22536#[doc = "ID: 12904"]
22537#[derive(Debug, Clone, PartialEq)]
22538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22540#[cfg_attr(feature = "ts", derive(TS))]
22541#[cfg_attr(feature = "ts", ts(export))]
22542pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22543 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22544 pub operator_latitude: i32,
22545 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22546 pub operator_longitude: i32,
22547 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22548 pub area_ceiling: f32,
22549 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22550 pub area_floor: f32,
22551 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22552 pub operator_altitude_geo: f32,
22553 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22554 pub timestamp: u32,
22555 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22556 pub area_count: u16,
22557 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22558 pub area_radius: u16,
22559 #[doc = "System ID (0 for broadcast)."]
22560 pub target_system: u8,
22561 #[doc = "Component ID (0 for broadcast)."]
22562 pub target_component: u8,
22563 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22564 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22565 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22566 pub id_or_mac: [u8; 20],
22567 #[doc = "Specifies the operator location type."]
22568 pub operator_location_type: MavOdidOperatorLocationType,
22569 #[doc = "Specifies the classification type of the UA."]
22570 pub classification_type: MavOdidClassificationType,
22571 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22572 pub category_eu: MavOdidCategoryEu,
22573 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22574 pub class_eu: MavOdidClassEu,
22575}
22576impl OPEN_DRONE_ID_SYSTEM_DATA {
22577 pub const ENCODED_LEN: usize = 54usize;
22578 pub const DEFAULT: Self = Self {
22579 operator_latitude: 0_i32,
22580 operator_longitude: 0_i32,
22581 area_ceiling: 0.0_f32,
22582 area_floor: 0.0_f32,
22583 operator_altitude_geo: 0.0_f32,
22584 timestamp: 0_u32,
22585 area_count: 0_u16,
22586 area_radius: 0_u16,
22587 target_system: 0_u8,
22588 target_component: 0_u8,
22589 id_or_mac: [0_u8; 20usize],
22590 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22591 classification_type: MavOdidClassificationType::DEFAULT,
22592 category_eu: MavOdidCategoryEu::DEFAULT,
22593 class_eu: MavOdidClassEu::DEFAULT,
22594 };
22595 #[cfg(feature = "arbitrary")]
22596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22597 use arbitrary::{Arbitrary, Unstructured};
22598 let mut buf = [0u8; 1024];
22599 rng.fill_bytes(&mut buf);
22600 let mut unstructured = Unstructured::new(&buf);
22601 Self::arbitrary(&mut unstructured).unwrap_or_default()
22602 }
22603}
22604impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22605 fn default() -> Self {
22606 Self::DEFAULT.clone()
22607 }
22608}
22609impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22610 type Message = MavMessage;
22611 const ID: u32 = 12904u32;
22612 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22613 const EXTRA_CRC: u8 = 77u8;
22614 const ENCODED_LEN: usize = 54usize;
22615 fn deser(
22616 _version: MavlinkVersion,
22617 __input: &[u8],
22618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22619 let avail_len = __input.len();
22620 let mut payload_buf = [0; Self::ENCODED_LEN];
22621 let mut buf = if avail_len < Self::ENCODED_LEN {
22622 payload_buf[0..avail_len].copy_from_slice(__input);
22623 Bytes::new(&payload_buf)
22624 } else {
22625 Bytes::new(__input)
22626 };
22627 let mut __struct = Self::default();
22628 __struct.operator_latitude = buf.get_i32_le();
22629 __struct.operator_longitude = buf.get_i32_le();
22630 __struct.area_ceiling = buf.get_f32_le();
22631 __struct.area_floor = buf.get_f32_le();
22632 __struct.operator_altitude_geo = buf.get_f32_le();
22633 __struct.timestamp = buf.get_u32_le();
22634 __struct.area_count = buf.get_u16_le();
22635 __struct.area_radius = buf.get_u16_le();
22636 __struct.target_system = buf.get_u8();
22637 __struct.target_component = buf.get_u8();
22638 for v in &mut __struct.id_or_mac {
22639 let val = buf.get_u8();
22640 *v = val;
22641 }
22642 let tmp = buf.get_u8();
22643 __struct.operator_location_type =
22644 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22645 enum_type: "MavOdidOperatorLocationType",
22646 value: tmp as u32,
22647 })?;
22648 let tmp = buf.get_u8();
22649 __struct.classification_type =
22650 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22651 enum_type: "MavOdidClassificationType",
22652 value: tmp as u32,
22653 })?;
22654 let tmp = buf.get_u8();
22655 __struct.category_eu =
22656 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22657 enum_type: "MavOdidCategoryEu",
22658 value: tmp as u32,
22659 })?;
22660 let tmp = buf.get_u8();
22661 __struct.class_eu =
22662 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22663 enum_type: "MavOdidClassEu",
22664 value: tmp as u32,
22665 })?;
22666 Ok(__struct)
22667 }
22668 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22669 let mut __tmp = BytesMut::new(bytes);
22670 #[allow(clippy::absurd_extreme_comparisons)]
22671 #[allow(unused_comparisons)]
22672 if __tmp.remaining() < Self::ENCODED_LEN {
22673 panic!(
22674 "buffer is too small (need {} bytes, but got {})",
22675 Self::ENCODED_LEN,
22676 __tmp.remaining(),
22677 )
22678 }
22679 __tmp.put_i32_le(self.operator_latitude);
22680 __tmp.put_i32_le(self.operator_longitude);
22681 __tmp.put_f32_le(self.area_ceiling);
22682 __tmp.put_f32_le(self.area_floor);
22683 __tmp.put_f32_le(self.operator_altitude_geo);
22684 __tmp.put_u32_le(self.timestamp);
22685 __tmp.put_u16_le(self.area_count);
22686 __tmp.put_u16_le(self.area_radius);
22687 __tmp.put_u8(self.target_system);
22688 __tmp.put_u8(self.target_component);
22689 for val in &self.id_or_mac {
22690 __tmp.put_u8(*val);
22691 }
22692 __tmp.put_u8(self.operator_location_type as u8);
22693 __tmp.put_u8(self.classification_type as u8);
22694 __tmp.put_u8(self.category_eu as u8);
22695 __tmp.put_u8(self.class_eu as u8);
22696 if matches!(version, MavlinkVersion::V2) {
22697 let len = __tmp.len();
22698 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22699 } else {
22700 __tmp.len()
22701 }
22702 }
22703}
22704#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22705#[doc = ""]
22706#[doc = "ID: 12919"]
22707#[derive(Debug, Clone, PartialEq)]
22708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22710#[cfg_attr(feature = "ts", derive(TS))]
22711#[cfg_attr(feature = "ts", ts(export))]
22712pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22713 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22714 pub operator_latitude: i32,
22715 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22716 pub operator_longitude: i32,
22717 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22718 pub operator_altitude_geo: f32,
22719 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22720 pub timestamp: u32,
22721 #[doc = "System ID (0 for broadcast)."]
22722 pub target_system: u8,
22723 #[doc = "Component ID (0 for broadcast)."]
22724 pub target_component: u8,
22725}
22726impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22727 pub const ENCODED_LEN: usize = 18usize;
22728 pub const DEFAULT: Self = Self {
22729 operator_latitude: 0_i32,
22730 operator_longitude: 0_i32,
22731 operator_altitude_geo: 0.0_f32,
22732 timestamp: 0_u32,
22733 target_system: 0_u8,
22734 target_component: 0_u8,
22735 };
22736 #[cfg(feature = "arbitrary")]
22737 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22738 use arbitrary::{Arbitrary, Unstructured};
22739 let mut buf = [0u8; 1024];
22740 rng.fill_bytes(&mut buf);
22741 let mut unstructured = Unstructured::new(&buf);
22742 Self::arbitrary(&mut unstructured).unwrap_or_default()
22743 }
22744}
22745impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22746 fn default() -> Self {
22747 Self::DEFAULT.clone()
22748 }
22749}
22750impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22751 type Message = MavMessage;
22752 const ID: u32 = 12919u32;
22753 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22754 const EXTRA_CRC: u8 = 7u8;
22755 const ENCODED_LEN: usize = 18usize;
22756 fn deser(
22757 _version: MavlinkVersion,
22758 __input: &[u8],
22759 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22760 let avail_len = __input.len();
22761 let mut payload_buf = [0; Self::ENCODED_LEN];
22762 let mut buf = if avail_len < Self::ENCODED_LEN {
22763 payload_buf[0..avail_len].copy_from_slice(__input);
22764 Bytes::new(&payload_buf)
22765 } else {
22766 Bytes::new(__input)
22767 };
22768 let mut __struct = Self::default();
22769 __struct.operator_latitude = buf.get_i32_le();
22770 __struct.operator_longitude = buf.get_i32_le();
22771 __struct.operator_altitude_geo = buf.get_f32_le();
22772 __struct.timestamp = buf.get_u32_le();
22773 __struct.target_system = buf.get_u8();
22774 __struct.target_component = buf.get_u8();
22775 Ok(__struct)
22776 }
22777 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22778 let mut __tmp = BytesMut::new(bytes);
22779 #[allow(clippy::absurd_extreme_comparisons)]
22780 #[allow(unused_comparisons)]
22781 if __tmp.remaining() < Self::ENCODED_LEN {
22782 panic!(
22783 "buffer is too small (need {} bytes, but got {})",
22784 Self::ENCODED_LEN,
22785 __tmp.remaining(),
22786 )
22787 }
22788 __tmp.put_i32_le(self.operator_latitude);
22789 __tmp.put_i32_le(self.operator_longitude);
22790 __tmp.put_f32_le(self.operator_altitude_geo);
22791 __tmp.put_u32_le(self.timestamp);
22792 __tmp.put_u8(self.target_system);
22793 __tmp.put_u8(self.target_component);
22794 if matches!(version, MavlinkVersion::V2) {
22795 let len = __tmp.len();
22796 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22797 } else {
22798 __tmp.len()
22799 }
22800 }
22801}
22802#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22803#[doc = ""]
22804#[doc = "ID: 100"]
22805#[derive(Debug, Clone, PartialEq)]
22806#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22807#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22808#[cfg_attr(feature = "ts", derive(TS))]
22809#[cfg_attr(feature = "ts", ts(export))]
22810pub struct OPTICAL_FLOW_DATA {
22811 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22812 pub time_usec: u64,
22813 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22814 pub flow_comp_m_x: f32,
22815 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22816 pub flow_comp_m_y: f32,
22817 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22818 pub ground_distance: f32,
22819 #[doc = "Flow in x-sensor direction"]
22820 pub flow_x: i16,
22821 #[doc = "Flow in y-sensor direction"]
22822 pub flow_y: i16,
22823 #[doc = "Sensor ID"]
22824 pub sensor_id: u8,
22825 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22826 pub quality: u8,
22827 #[doc = "Flow rate about X axis"]
22828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22829 pub flow_rate_x: f32,
22830 #[doc = "Flow rate about Y axis"]
22831 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22832 pub flow_rate_y: f32,
22833}
22834impl OPTICAL_FLOW_DATA {
22835 pub const ENCODED_LEN: usize = 34usize;
22836 pub const DEFAULT: Self = Self {
22837 time_usec: 0_u64,
22838 flow_comp_m_x: 0.0_f32,
22839 flow_comp_m_y: 0.0_f32,
22840 ground_distance: 0.0_f32,
22841 flow_x: 0_i16,
22842 flow_y: 0_i16,
22843 sensor_id: 0_u8,
22844 quality: 0_u8,
22845 flow_rate_x: 0.0_f32,
22846 flow_rate_y: 0.0_f32,
22847 };
22848 #[cfg(feature = "arbitrary")]
22849 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22850 use arbitrary::{Arbitrary, Unstructured};
22851 let mut buf = [0u8; 1024];
22852 rng.fill_bytes(&mut buf);
22853 let mut unstructured = Unstructured::new(&buf);
22854 Self::arbitrary(&mut unstructured).unwrap_or_default()
22855 }
22856}
22857impl Default for OPTICAL_FLOW_DATA {
22858 fn default() -> Self {
22859 Self::DEFAULT.clone()
22860 }
22861}
22862impl MessageData for OPTICAL_FLOW_DATA {
22863 type Message = MavMessage;
22864 const ID: u32 = 100u32;
22865 const NAME: &'static str = "OPTICAL_FLOW";
22866 const EXTRA_CRC: u8 = 175u8;
22867 const ENCODED_LEN: usize = 34usize;
22868 fn deser(
22869 _version: MavlinkVersion,
22870 __input: &[u8],
22871 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22872 let avail_len = __input.len();
22873 let mut payload_buf = [0; Self::ENCODED_LEN];
22874 let mut buf = if avail_len < Self::ENCODED_LEN {
22875 payload_buf[0..avail_len].copy_from_slice(__input);
22876 Bytes::new(&payload_buf)
22877 } else {
22878 Bytes::new(__input)
22879 };
22880 let mut __struct = Self::default();
22881 __struct.time_usec = buf.get_u64_le();
22882 __struct.flow_comp_m_x = buf.get_f32_le();
22883 __struct.flow_comp_m_y = buf.get_f32_le();
22884 __struct.ground_distance = buf.get_f32_le();
22885 __struct.flow_x = buf.get_i16_le();
22886 __struct.flow_y = buf.get_i16_le();
22887 __struct.sensor_id = buf.get_u8();
22888 __struct.quality = buf.get_u8();
22889 __struct.flow_rate_x = buf.get_f32_le();
22890 __struct.flow_rate_y = buf.get_f32_le();
22891 Ok(__struct)
22892 }
22893 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22894 let mut __tmp = BytesMut::new(bytes);
22895 #[allow(clippy::absurd_extreme_comparisons)]
22896 #[allow(unused_comparisons)]
22897 if __tmp.remaining() < Self::ENCODED_LEN {
22898 panic!(
22899 "buffer is too small (need {} bytes, but got {})",
22900 Self::ENCODED_LEN,
22901 __tmp.remaining(),
22902 )
22903 }
22904 __tmp.put_u64_le(self.time_usec);
22905 __tmp.put_f32_le(self.flow_comp_m_x);
22906 __tmp.put_f32_le(self.flow_comp_m_y);
22907 __tmp.put_f32_le(self.ground_distance);
22908 __tmp.put_i16_le(self.flow_x);
22909 __tmp.put_i16_le(self.flow_y);
22910 __tmp.put_u8(self.sensor_id);
22911 __tmp.put_u8(self.quality);
22912 if matches!(version, MavlinkVersion::V2) {
22913 __tmp.put_f32_le(self.flow_rate_x);
22914 __tmp.put_f32_le(self.flow_rate_y);
22915 let len = __tmp.len();
22916 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22917 } else {
22918 __tmp.len()
22919 }
22920 }
22921}
22922#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22923#[doc = ""]
22924#[doc = "ID: 106"]
22925#[derive(Debug, Clone, PartialEq)]
22926#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22927#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22928#[cfg_attr(feature = "ts", derive(TS))]
22929#[cfg_attr(feature = "ts", ts(export))]
22930pub struct OPTICAL_FLOW_RAD_DATA {
22931 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22932 pub time_usec: u64,
22933 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22934 pub integration_time_us: u32,
22935 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22936 pub integrated_x: f32,
22937 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22938 pub integrated_y: f32,
22939 #[doc = "RH rotation around X axis"]
22940 pub integrated_xgyro: f32,
22941 #[doc = "RH rotation around Y axis"]
22942 pub integrated_ygyro: f32,
22943 #[doc = "RH rotation around Z axis"]
22944 pub integrated_zgyro: f32,
22945 #[doc = "Time since the distance was sampled."]
22946 pub time_delta_distance_us: u32,
22947 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22948 pub distance: f32,
22949 #[doc = "Temperature"]
22950 pub temperature: i16,
22951 #[doc = "Sensor ID"]
22952 pub sensor_id: u8,
22953 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22954 pub quality: u8,
22955}
22956impl OPTICAL_FLOW_RAD_DATA {
22957 pub const ENCODED_LEN: usize = 44usize;
22958 pub const DEFAULT: Self = Self {
22959 time_usec: 0_u64,
22960 integration_time_us: 0_u32,
22961 integrated_x: 0.0_f32,
22962 integrated_y: 0.0_f32,
22963 integrated_xgyro: 0.0_f32,
22964 integrated_ygyro: 0.0_f32,
22965 integrated_zgyro: 0.0_f32,
22966 time_delta_distance_us: 0_u32,
22967 distance: 0.0_f32,
22968 temperature: 0_i16,
22969 sensor_id: 0_u8,
22970 quality: 0_u8,
22971 };
22972 #[cfg(feature = "arbitrary")]
22973 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22974 use arbitrary::{Arbitrary, Unstructured};
22975 let mut buf = [0u8; 1024];
22976 rng.fill_bytes(&mut buf);
22977 let mut unstructured = Unstructured::new(&buf);
22978 Self::arbitrary(&mut unstructured).unwrap_or_default()
22979 }
22980}
22981impl Default for OPTICAL_FLOW_RAD_DATA {
22982 fn default() -> Self {
22983 Self::DEFAULT.clone()
22984 }
22985}
22986impl MessageData for OPTICAL_FLOW_RAD_DATA {
22987 type Message = MavMessage;
22988 const ID: u32 = 106u32;
22989 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22990 const EXTRA_CRC: u8 = 138u8;
22991 const ENCODED_LEN: usize = 44usize;
22992 fn deser(
22993 _version: MavlinkVersion,
22994 __input: &[u8],
22995 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22996 let avail_len = __input.len();
22997 let mut payload_buf = [0; Self::ENCODED_LEN];
22998 let mut buf = if avail_len < Self::ENCODED_LEN {
22999 payload_buf[0..avail_len].copy_from_slice(__input);
23000 Bytes::new(&payload_buf)
23001 } else {
23002 Bytes::new(__input)
23003 };
23004 let mut __struct = Self::default();
23005 __struct.time_usec = buf.get_u64_le();
23006 __struct.integration_time_us = buf.get_u32_le();
23007 __struct.integrated_x = buf.get_f32_le();
23008 __struct.integrated_y = buf.get_f32_le();
23009 __struct.integrated_xgyro = buf.get_f32_le();
23010 __struct.integrated_ygyro = buf.get_f32_le();
23011 __struct.integrated_zgyro = buf.get_f32_le();
23012 __struct.time_delta_distance_us = buf.get_u32_le();
23013 __struct.distance = buf.get_f32_le();
23014 __struct.temperature = buf.get_i16_le();
23015 __struct.sensor_id = buf.get_u8();
23016 __struct.quality = buf.get_u8();
23017 Ok(__struct)
23018 }
23019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23020 let mut __tmp = BytesMut::new(bytes);
23021 #[allow(clippy::absurd_extreme_comparisons)]
23022 #[allow(unused_comparisons)]
23023 if __tmp.remaining() < Self::ENCODED_LEN {
23024 panic!(
23025 "buffer is too small (need {} bytes, but got {})",
23026 Self::ENCODED_LEN,
23027 __tmp.remaining(),
23028 )
23029 }
23030 __tmp.put_u64_le(self.time_usec);
23031 __tmp.put_u32_le(self.integration_time_us);
23032 __tmp.put_f32_le(self.integrated_x);
23033 __tmp.put_f32_le(self.integrated_y);
23034 __tmp.put_f32_le(self.integrated_xgyro);
23035 __tmp.put_f32_le(self.integrated_ygyro);
23036 __tmp.put_f32_le(self.integrated_zgyro);
23037 __tmp.put_u32_le(self.time_delta_distance_us);
23038 __tmp.put_f32_le(self.distance);
23039 __tmp.put_i16_le(self.temperature);
23040 __tmp.put_u8(self.sensor_id);
23041 __tmp.put_u8(self.quality);
23042 if matches!(version, MavlinkVersion::V2) {
23043 let len = __tmp.len();
23044 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23045 } else {
23046 __tmp.len()
23047 }
23048 }
23049}
23050#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23051#[doc = ""]
23052#[doc = "ID: 360"]
23053#[derive(Debug, Clone, PartialEq)]
23054#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23056#[cfg_attr(feature = "ts", derive(TS))]
23057#[cfg_attr(feature = "ts", ts(export))]
23058pub struct ORBIT_EXECUTION_STATUS_DATA {
23059 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23060 pub time_usec: u64,
23061 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23062 pub radius: f32,
23063 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23064 pub x: i32,
23065 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23066 pub y: i32,
23067 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23068 pub z: f32,
23069 #[doc = "The coordinate system of the fields: x, y, z."]
23070 pub frame: MavFrame,
23071}
23072impl ORBIT_EXECUTION_STATUS_DATA {
23073 pub const ENCODED_LEN: usize = 25usize;
23074 pub const DEFAULT: Self = Self {
23075 time_usec: 0_u64,
23076 radius: 0.0_f32,
23077 x: 0_i32,
23078 y: 0_i32,
23079 z: 0.0_f32,
23080 frame: MavFrame::DEFAULT,
23081 };
23082 #[cfg(feature = "arbitrary")]
23083 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23084 use arbitrary::{Arbitrary, Unstructured};
23085 let mut buf = [0u8; 1024];
23086 rng.fill_bytes(&mut buf);
23087 let mut unstructured = Unstructured::new(&buf);
23088 Self::arbitrary(&mut unstructured).unwrap_or_default()
23089 }
23090}
23091impl Default for ORBIT_EXECUTION_STATUS_DATA {
23092 fn default() -> Self {
23093 Self::DEFAULT.clone()
23094 }
23095}
23096impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23097 type Message = MavMessage;
23098 const ID: u32 = 360u32;
23099 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23100 const EXTRA_CRC: u8 = 11u8;
23101 const ENCODED_LEN: usize = 25usize;
23102 fn deser(
23103 _version: MavlinkVersion,
23104 __input: &[u8],
23105 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23106 let avail_len = __input.len();
23107 let mut payload_buf = [0; Self::ENCODED_LEN];
23108 let mut buf = if avail_len < Self::ENCODED_LEN {
23109 payload_buf[0..avail_len].copy_from_slice(__input);
23110 Bytes::new(&payload_buf)
23111 } else {
23112 Bytes::new(__input)
23113 };
23114 let mut __struct = Self::default();
23115 __struct.time_usec = buf.get_u64_le();
23116 __struct.radius = buf.get_f32_le();
23117 __struct.x = buf.get_i32_le();
23118 __struct.y = buf.get_i32_le();
23119 __struct.z = buf.get_f32_le();
23120 let tmp = buf.get_u8();
23121 __struct.frame =
23122 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23123 enum_type: "MavFrame",
23124 value: tmp as u32,
23125 })?;
23126 Ok(__struct)
23127 }
23128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23129 let mut __tmp = BytesMut::new(bytes);
23130 #[allow(clippy::absurd_extreme_comparisons)]
23131 #[allow(unused_comparisons)]
23132 if __tmp.remaining() < Self::ENCODED_LEN {
23133 panic!(
23134 "buffer is too small (need {} bytes, but got {})",
23135 Self::ENCODED_LEN,
23136 __tmp.remaining(),
23137 )
23138 }
23139 __tmp.put_u64_le(self.time_usec);
23140 __tmp.put_f32_le(self.radius);
23141 __tmp.put_i32_le(self.x);
23142 __tmp.put_i32_le(self.y);
23143 __tmp.put_f32_le(self.z);
23144 __tmp.put_u8(self.frame as u8);
23145 if matches!(version, MavlinkVersion::V2) {
23146 let len = __tmp.len();
23147 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23148 } else {
23149 __tmp.len()
23150 }
23151 }
23152}
23153#[doc = "Response from a PARAM_EXT_SET message."]
23154#[doc = ""]
23155#[doc = "ID: 324"]
23156#[derive(Debug, Clone, PartialEq)]
23157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23159#[cfg_attr(feature = "ts", derive(TS))]
23160#[cfg_attr(feature = "ts", ts(export))]
23161pub struct PARAM_EXT_ACK_DATA {
23162 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23163 #[cfg_attr(
23164 feature = "serde",
23165 serde(
23166 serialize_with = "crate::nulstr::serialize::<_, 16>",
23167 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23168 )
23169 )]
23170 #[cfg_attr(feature = "ts", ts(type = "string"))]
23171 pub param_id: [u8; 16],
23172 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23173 #[cfg_attr(
23174 feature = "serde",
23175 serde(
23176 serialize_with = "crate::nulstr::serialize::<_, 128>",
23177 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
23178 )
23179 )]
23180 #[cfg_attr(feature = "ts", ts(type = "string"))]
23181 pub param_value: [u8; 128],
23182 #[doc = "Parameter type."]
23183 pub param_type: MavParamExtType,
23184 #[doc = "Result code."]
23185 pub param_result: ParamAck,
23186}
23187impl PARAM_EXT_ACK_DATA {
23188 pub const ENCODED_LEN: usize = 146usize;
23189 pub const DEFAULT: Self = Self {
23190 param_id: [0_u8; 16usize],
23191 param_value: [0_u8; 128usize],
23192 param_type: MavParamExtType::DEFAULT,
23193 param_result: ParamAck::DEFAULT,
23194 };
23195 #[cfg(feature = "arbitrary")]
23196 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23197 use arbitrary::{Arbitrary, Unstructured};
23198 let mut buf = [0u8; 1024];
23199 rng.fill_bytes(&mut buf);
23200 let mut unstructured = Unstructured::new(&buf);
23201 Self::arbitrary(&mut unstructured).unwrap_or_default()
23202 }
23203}
23204impl Default for PARAM_EXT_ACK_DATA {
23205 fn default() -> Self {
23206 Self::DEFAULT.clone()
23207 }
23208}
23209impl MessageData for PARAM_EXT_ACK_DATA {
23210 type Message = MavMessage;
23211 const ID: u32 = 324u32;
23212 const NAME: &'static str = "PARAM_EXT_ACK";
23213 const EXTRA_CRC: u8 = 132u8;
23214 const ENCODED_LEN: usize = 146usize;
23215 fn deser(
23216 _version: MavlinkVersion,
23217 __input: &[u8],
23218 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23219 let avail_len = __input.len();
23220 let mut payload_buf = [0; Self::ENCODED_LEN];
23221 let mut buf = if avail_len < Self::ENCODED_LEN {
23222 payload_buf[0..avail_len].copy_from_slice(__input);
23223 Bytes::new(&payload_buf)
23224 } else {
23225 Bytes::new(__input)
23226 };
23227 let mut __struct = Self::default();
23228 for v in &mut __struct.param_id {
23229 let val = buf.get_u8();
23230 *v = val;
23231 }
23232 for v in &mut __struct.param_value {
23233 let val = buf.get_u8();
23234 *v = val;
23235 }
23236 let tmp = buf.get_u8();
23237 __struct.param_type =
23238 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23239 enum_type: "MavParamExtType",
23240 value: tmp as u32,
23241 })?;
23242 let tmp = buf.get_u8();
23243 __struct.param_result =
23244 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23245 enum_type: "ParamAck",
23246 value: tmp as u32,
23247 })?;
23248 Ok(__struct)
23249 }
23250 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23251 let mut __tmp = BytesMut::new(bytes);
23252 #[allow(clippy::absurd_extreme_comparisons)]
23253 #[allow(unused_comparisons)]
23254 if __tmp.remaining() < Self::ENCODED_LEN {
23255 panic!(
23256 "buffer is too small (need {} bytes, but got {})",
23257 Self::ENCODED_LEN,
23258 __tmp.remaining(),
23259 )
23260 }
23261 for val in &self.param_id {
23262 __tmp.put_u8(*val);
23263 }
23264 for val in &self.param_value {
23265 __tmp.put_u8(*val);
23266 }
23267 __tmp.put_u8(self.param_type as u8);
23268 __tmp.put_u8(self.param_result as u8);
23269 if matches!(version, MavlinkVersion::V2) {
23270 let len = __tmp.len();
23271 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23272 } else {
23273 __tmp.len()
23274 }
23275 }
23276}
23277#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23278#[doc = ""]
23279#[doc = "ID: 321"]
23280#[derive(Debug, Clone, PartialEq)]
23281#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23282#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23283#[cfg_attr(feature = "ts", derive(TS))]
23284#[cfg_attr(feature = "ts", ts(export))]
23285pub struct PARAM_EXT_REQUEST_LIST_DATA {
23286 #[doc = "System ID"]
23287 pub target_system: u8,
23288 #[doc = "Component ID"]
23289 pub target_component: u8,
23290}
23291impl PARAM_EXT_REQUEST_LIST_DATA {
23292 pub const ENCODED_LEN: usize = 2usize;
23293 pub const DEFAULT: Self = Self {
23294 target_system: 0_u8,
23295 target_component: 0_u8,
23296 };
23297 #[cfg(feature = "arbitrary")]
23298 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23299 use arbitrary::{Arbitrary, Unstructured};
23300 let mut buf = [0u8; 1024];
23301 rng.fill_bytes(&mut buf);
23302 let mut unstructured = Unstructured::new(&buf);
23303 Self::arbitrary(&mut unstructured).unwrap_or_default()
23304 }
23305}
23306impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23307 fn default() -> Self {
23308 Self::DEFAULT.clone()
23309 }
23310}
23311impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23312 type Message = MavMessage;
23313 const ID: u32 = 321u32;
23314 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23315 const EXTRA_CRC: u8 = 88u8;
23316 const ENCODED_LEN: usize = 2usize;
23317 fn deser(
23318 _version: MavlinkVersion,
23319 __input: &[u8],
23320 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23321 let avail_len = __input.len();
23322 let mut payload_buf = [0; Self::ENCODED_LEN];
23323 let mut buf = if avail_len < Self::ENCODED_LEN {
23324 payload_buf[0..avail_len].copy_from_slice(__input);
23325 Bytes::new(&payload_buf)
23326 } else {
23327 Bytes::new(__input)
23328 };
23329 let mut __struct = Self::default();
23330 __struct.target_system = buf.get_u8();
23331 __struct.target_component = buf.get_u8();
23332 Ok(__struct)
23333 }
23334 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23335 let mut __tmp = BytesMut::new(bytes);
23336 #[allow(clippy::absurd_extreme_comparisons)]
23337 #[allow(unused_comparisons)]
23338 if __tmp.remaining() < Self::ENCODED_LEN {
23339 panic!(
23340 "buffer is too small (need {} bytes, but got {})",
23341 Self::ENCODED_LEN,
23342 __tmp.remaining(),
23343 )
23344 }
23345 __tmp.put_u8(self.target_system);
23346 __tmp.put_u8(self.target_component);
23347 if matches!(version, MavlinkVersion::V2) {
23348 let len = __tmp.len();
23349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23350 } else {
23351 __tmp.len()
23352 }
23353 }
23354}
23355#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23356#[doc = ""]
23357#[doc = "ID: 320"]
23358#[derive(Debug, Clone, PartialEq)]
23359#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23360#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23361#[cfg_attr(feature = "ts", derive(TS))]
23362#[cfg_attr(feature = "ts", ts(export))]
23363pub struct PARAM_EXT_REQUEST_READ_DATA {
23364 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23365 pub param_index: i16,
23366 #[doc = "System ID"]
23367 pub target_system: u8,
23368 #[doc = "Component ID"]
23369 pub target_component: u8,
23370 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23371 #[cfg_attr(
23372 feature = "serde",
23373 serde(
23374 serialize_with = "crate::nulstr::serialize::<_, 16>",
23375 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23376 )
23377 )]
23378 #[cfg_attr(feature = "ts", ts(type = "string"))]
23379 pub param_id: [u8; 16],
23380}
23381impl PARAM_EXT_REQUEST_READ_DATA {
23382 pub const ENCODED_LEN: usize = 20usize;
23383 pub const DEFAULT: Self = Self {
23384 param_index: 0_i16,
23385 target_system: 0_u8,
23386 target_component: 0_u8,
23387 param_id: [0_u8; 16usize],
23388 };
23389 #[cfg(feature = "arbitrary")]
23390 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23391 use arbitrary::{Arbitrary, Unstructured};
23392 let mut buf = [0u8; 1024];
23393 rng.fill_bytes(&mut buf);
23394 let mut unstructured = Unstructured::new(&buf);
23395 Self::arbitrary(&mut unstructured).unwrap_or_default()
23396 }
23397}
23398impl Default for PARAM_EXT_REQUEST_READ_DATA {
23399 fn default() -> Self {
23400 Self::DEFAULT.clone()
23401 }
23402}
23403impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23404 type Message = MavMessage;
23405 const ID: u32 = 320u32;
23406 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23407 const EXTRA_CRC: u8 = 243u8;
23408 const ENCODED_LEN: usize = 20usize;
23409 fn deser(
23410 _version: MavlinkVersion,
23411 __input: &[u8],
23412 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23413 let avail_len = __input.len();
23414 let mut payload_buf = [0; Self::ENCODED_LEN];
23415 let mut buf = if avail_len < Self::ENCODED_LEN {
23416 payload_buf[0..avail_len].copy_from_slice(__input);
23417 Bytes::new(&payload_buf)
23418 } else {
23419 Bytes::new(__input)
23420 };
23421 let mut __struct = Self::default();
23422 __struct.param_index = buf.get_i16_le();
23423 __struct.target_system = buf.get_u8();
23424 __struct.target_component = buf.get_u8();
23425 for v in &mut __struct.param_id {
23426 let val = buf.get_u8();
23427 *v = val;
23428 }
23429 Ok(__struct)
23430 }
23431 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23432 let mut __tmp = BytesMut::new(bytes);
23433 #[allow(clippy::absurd_extreme_comparisons)]
23434 #[allow(unused_comparisons)]
23435 if __tmp.remaining() < Self::ENCODED_LEN {
23436 panic!(
23437 "buffer is too small (need {} bytes, but got {})",
23438 Self::ENCODED_LEN,
23439 __tmp.remaining(),
23440 )
23441 }
23442 __tmp.put_i16_le(self.param_index);
23443 __tmp.put_u8(self.target_system);
23444 __tmp.put_u8(self.target_component);
23445 for val in &self.param_id {
23446 __tmp.put_u8(*val);
23447 }
23448 if matches!(version, MavlinkVersion::V2) {
23449 let len = __tmp.len();
23450 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23451 } else {
23452 __tmp.len()
23453 }
23454 }
23455}
23456#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23457#[doc = ""]
23458#[doc = "ID: 323"]
23459#[derive(Debug, Clone, PartialEq)]
23460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23462#[cfg_attr(feature = "ts", derive(TS))]
23463#[cfg_attr(feature = "ts", ts(export))]
23464pub struct PARAM_EXT_SET_DATA {
23465 #[doc = "System ID"]
23466 pub target_system: u8,
23467 #[doc = "Component ID"]
23468 pub target_component: u8,
23469 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23470 #[cfg_attr(
23471 feature = "serde",
23472 serde(
23473 serialize_with = "crate::nulstr::serialize::<_, 16>",
23474 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23475 )
23476 )]
23477 #[cfg_attr(feature = "ts", ts(type = "string"))]
23478 pub param_id: [u8; 16],
23479 #[doc = "Parameter value"]
23480 #[cfg_attr(
23481 feature = "serde",
23482 serde(
23483 serialize_with = "crate::nulstr::serialize::<_, 128>",
23484 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
23485 )
23486 )]
23487 #[cfg_attr(feature = "ts", ts(type = "string"))]
23488 pub param_value: [u8; 128],
23489 #[doc = "Parameter type."]
23490 pub param_type: MavParamExtType,
23491}
23492impl PARAM_EXT_SET_DATA {
23493 pub const ENCODED_LEN: usize = 147usize;
23494 pub const DEFAULT: Self = Self {
23495 target_system: 0_u8,
23496 target_component: 0_u8,
23497 param_id: [0_u8; 16usize],
23498 param_value: [0_u8; 128usize],
23499 param_type: MavParamExtType::DEFAULT,
23500 };
23501 #[cfg(feature = "arbitrary")]
23502 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23503 use arbitrary::{Arbitrary, Unstructured};
23504 let mut buf = [0u8; 1024];
23505 rng.fill_bytes(&mut buf);
23506 let mut unstructured = Unstructured::new(&buf);
23507 Self::arbitrary(&mut unstructured).unwrap_or_default()
23508 }
23509}
23510impl Default for PARAM_EXT_SET_DATA {
23511 fn default() -> Self {
23512 Self::DEFAULT.clone()
23513 }
23514}
23515impl MessageData for PARAM_EXT_SET_DATA {
23516 type Message = MavMessage;
23517 const ID: u32 = 323u32;
23518 const NAME: &'static str = "PARAM_EXT_SET";
23519 const EXTRA_CRC: u8 = 78u8;
23520 const ENCODED_LEN: usize = 147usize;
23521 fn deser(
23522 _version: MavlinkVersion,
23523 __input: &[u8],
23524 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23525 let avail_len = __input.len();
23526 let mut payload_buf = [0; Self::ENCODED_LEN];
23527 let mut buf = if avail_len < Self::ENCODED_LEN {
23528 payload_buf[0..avail_len].copy_from_slice(__input);
23529 Bytes::new(&payload_buf)
23530 } else {
23531 Bytes::new(__input)
23532 };
23533 let mut __struct = Self::default();
23534 __struct.target_system = buf.get_u8();
23535 __struct.target_component = buf.get_u8();
23536 for v in &mut __struct.param_id {
23537 let val = buf.get_u8();
23538 *v = val;
23539 }
23540 for v in &mut __struct.param_value {
23541 let val = buf.get_u8();
23542 *v = val;
23543 }
23544 let tmp = buf.get_u8();
23545 __struct.param_type =
23546 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23547 enum_type: "MavParamExtType",
23548 value: tmp as u32,
23549 })?;
23550 Ok(__struct)
23551 }
23552 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23553 let mut __tmp = BytesMut::new(bytes);
23554 #[allow(clippy::absurd_extreme_comparisons)]
23555 #[allow(unused_comparisons)]
23556 if __tmp.remaining() < Self::ENCODED_LEN {
23557 panic!(
23558 "buffer is too small (need {} bytes, but got {})",
23559 Self::ENCODED_LEN,
23560 __tmp.remaining(),
23561 )
23562 }
23563 __tmp.put_u8(self.target_system);
23564 __tmp.put_u8(self.target_component);
23565 for val in &self.param_id {
23566 __tmp.put_u8(*val);
23567 }
23568 for val in &self.param_value {
23569 __tmp.put_u8(*val);
23570 }
23571 __tmp.put_u8(self.param_type as u8);
23572 if matches!(version, MavlinkVersion::V2) {
23573 let len = __tmp.len();
23574 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23575 } else {
23576 __tmp.len()
23577 }
23578 }
23579}
23580#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23581#[doc = ""]
23582#[doc = "ID: 322"]
23583#[derive(Debug, Clone, PartialEq)]
23584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23586#[cfg_attr(feature = "ts", derive(TS))]
23587#[cfg_attr(feature = "ts", ts(export))]
23588pub struct PARAM_EXT_VALUE_DATA {
23589 #[doc = "Total number of parameters"]
23590 pub param_count: u16,
23591 #[doc = "Index of this parameter"]
23592 pub param_index: u16,
23593 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23594 #[cfg_attr(
23595 feature = "serde",
23596 serde(
23597 serialize_with = "crate::nulstr::serialize::<_, 16>",
23598 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23599 )
23600 )]
23601 #[cfg_attr(feature = "ts", ts(type = "string"))]
23602 pub param_id: [u8; 16],
23603 #[doc = "Parameter value"]
23604 #[cfg_attr(
23605 feature = "serde",
23606 serde(
23607 serialize_with = "crate::nulstr::serialize::<_, 128>",
23608 deserialize_with = "crate::nulstr::deserialize::<_, 128>"
23609 )
23610 )]
23611 #[cfg_attr(feature = "ts", ts(type = "string"))]
23612 pub param_value: [u8; 128],
23613 #[doc = "Parameter type."]
23614 pub param_type: MavParamExtType,
23615}
23616impl PARAM_EXT_VALUE_DATA {
23617 pub const ENCODED_LEN: usize = 149usize;
23618 pub const DEFAULT: Self = Self {
23619 param_count: 0_u16,
23620 param_index: 0_u16,
23621 param_id: [0_u8; 16usize],
23622 param_value: [0_u8; 128usize],
23623 param_type: MavParamExtType::DEFAULT,
23624 };
23625 #[cfg(feature = "arbitrary")]
23626 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23627 use arbitrary::{Arbitrary, Unstructured};
23628 let mut buf = [0u8; 1024];
23629 rng.fill_bytes(&mut buf);
23630 let mut unstructured = Unstructured::new(&buf);
23631 Self::arbitrary(&mut unstructured).unwrap_or_default()
23632 }
23633}
23634impl Default for PARAM_EXT_VALUE_DATA {
23635 fn default() -> Self {
23636 Self::DEFAULT.clone()
23637 }
23638}
23639impl MessageData for PARAM_EXT_VALUE_DATA {
23640 type Message = MavMessage;
23641 const ID: u32 = 322u32;
23642 const NAME: &'static str = "PARAM_EXT_VALUE";
23643 const EXTRA_CRC: u8 = 243u8;
23644 const ENCODED_LEN: usize = 149usize;
23645 fn deser(
23646 _version: MavlinkVersion,
23647 __input: &[u8],
23648 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23649 let avail_len = __input.len();
23650 let mut payload_buf = [0; Self::ENCODED_LEN];
23651 let mut buf = if avail_len < Self::ENCODED_LEN {
23652 payload_buf[0..avail_len].copy_from_slice(__input);
23653 Bytes::new(&payload_buf)
23654 } else {
23655 Bytes::new(__input)
23656 };
23657 let mut __struct = Self::default();
23658 __struct.param_count = buf.get_u16_le();
23659 __struct.param_index = buf.get_u16_le();
23660 for v in &mut __struct.param_id {
23661 let val = buf.get_u8();
23662 *v = val;
23663 }
23664 for v in &mut __struct.param_value {
23665 let val = buf.get_u8();
23666 *v = val;
23667 }
23668 let tmp = buf.get_u8();
23669 __struct.param_type =
23670 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23671 enum_type: "MavParamExtType",
23672 value: tmp as u32,
23673 })?;
23674 Ok(__struct)
23675 }
23676 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23677 let mut __tmp = BytesMut::new(bytes);
23678 #[allow(clippy::absurd_extreme_comparisons)]
23679 #[allow(unused_comparisons)]
23680 if __tmp.remaining() < Self::ENCODED_LEN {
23681 panic!(
23682 "buffer is too small (need {} bytes, but got {})",
23683 Self::ENCODED_LEN,
23684 __tmp.remaining(),
23685 )
23686 }
23687 __tmp.put_u16_le(self.param_count);
23688 __tmp.put_u16_le(self.param_index);
23689 for val in &self.param_id {
23690 __tmp.put_u8(*val);
23691 }
23692 for val in &self.param_value {
23693 __tmp.put_u8(*val);
23694 }
23695 __tmp.put_u8(self.param_type as u8);
23696 if matches!(version, MavlinkVersion::V2) {
23697 let len = __tmp.len();
23698 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23699 } else {
23700 __tmp.len()
23701 }
23702 }
23703}
23704#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23705#[doc = ""]
23706#[doc = "ID: 50"]
23707#[derive(Debug, Clone, PartialEq)]
23708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23710#[cfg_attr(feature = "ts", derive(TS))]
23711#[cfg_attr(feature = "ts", ts(export))]
23712pub struct PARAM_MAP_RC_DATA {
23713 #[doc = "Initial parameter value"]
23714 pub param_value0: f32,
23715 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23716 pub scale: f32,
23717 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23718 pub param_value_min: f32,
23719 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23720 pub param_value_max: f32,
23721 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23722 pub param_index: i16,
23723 #[doc = "System ID"]
23724 pub target_system: u8,
23725 #[doc = "Component ID"]
23726 pub target_component: u8,
23727 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23728 #[cfg_attr(
23729 feature = "serde",
23730 serde(
23731 serialize_with = "crate::nulstr::serialize::<_, 16>",
23732 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23733 )
23734 )]
23735 #[cfg_attr(feature = "ts", ts(type = "string"))]
23736 pub param_id: [u8; 16],
23737 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23738 pub parameter_rc_channel_index: u8,
23739}
23740impl PARAM_MAP_RC_DATA {
23741 pub const ENCODED_LEN: usize = 37usize;
23742 pub const DEFAULT: Self = Self {
23743 param_value0: 0.0_f32,
23744 scale: 0.0_f32,
23745 param_value_min: 0.0_f32,
23746 param_value_max: 0.0_f32,
23747 param_index: 0_i16,
23748 target_system: 0_u8,
23749 target_component: 0_u8,
23750 param_id: [0_u8; 16usize],
23751 parameter_rc_channel_index: 0_u8,
23752 };
23753 #[cfg(feature = "arbitrary")]
23754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23755 use arbitrary::{Arbitrary, Unstructured};
23756 let mut buf = [0u8; 1024];
23757 rng.fill_bytes(&mut buf);
23758 let mut unstructured = Unstructured::new(&buf);
23759 Self::arbitrary(&mut unstructured).unwrap_or_default()
23760 }
23761}
23762impl Default for PARAM_MAP_RC_DATA {
23763 fn default() -> Self {
23764 Self::DEFAULT.clone()
23765 }
23766}
23767impl MessageData for PARAM_MAP_RC_DATA {
23768 type Message = MavMessage;
23769 const ID: u32 = 50u32;
23770 const NAME: &'static str = "PARAM_MAP_RC";
23771 const EXTRA_CRC: u8 = 78u8;
23772 const ENCODED_LEN: usize = 37usize;
23773 fn deser(
23774 _version: MavlinkVersion,
23775 __input: &[u8],
23776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23777 let avail_len = __input.len();
23778 let mut payload_buf = [0; Self::ENCODED_LEN];
23779 let mut buf = if avail_len < Self::ENCODED_LEN {
23780 payload_buf[0..avail_len].copy_from_slice(__input);
23781 Bytes::new(&payload_buf)
23782 } else {
23783 Bytes::new(__input)
23784 };
23785 let mut __struct = Self::default();
23786 __struct.param_value0 = buf.get_f32_le();
23787 __struct.scale = buf.get_f32_le();
23788 __struct.param_value_min = buf.get_f32_le();
23789 __struct.param_value_max = buf.get_f32_le();
23790 __struct.param_index = buf.get_i16_le();
23791 __struct.target_system = buf.get_u8();
23792 __struct.target_component = buf.get_u8();
23793 for v in &mut __struct.param_id {
23794 let val = buf.get_u8();
23795 *v = val;
23796 }
23797 __struct.parameter_rc_channel_index = buf.get_u8();
23798 Ok(__struct)
23799 }
23800 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23801 let mut __tmp = BytesMut::new(bytes);
23802 #[allow(clippy::absurd_extreme_comparisons)]
23803 #[allow(unused_comparisons)]
23804 if __tmp.remaining() < Self::ENCODED_LEN {
23805 panic!(
23806 "buffer is too small (need {} bytes, but got {})",
23807 Self::ENCODED_LEN,
23808 __tmp.remaining(),
23809 )
23810 }
23811 __tmp.put_f32_le(self.param_value0);
23812 __tmp.put_f32_le(self.scale);
23813 __tmp.put_f32_le(self.param_value_min);
23814 __tmp.put_f32_le(self.param_value_max);
23815 __tmp.put_i16_le(self.param_index);
23816 __tmp.put_u8(self.target_system);
23817 __tmp.put_u8(self.target_component);
23818 for val in &self.param_id {
23819 __tmp.put_u8(*val);
23820 }
23821 __tmp.put_u8(self.parameter_rc_channel_index);
23822 if matches!(version, MavlinkVersion::V2) {
23823 let len = __tmp.len();
23824 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23825 } else {
23826 __tmp.len()
23827 }
23828 }
23829}
23830#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23831#[doc = ""]
23832#[doc = "ID: 21"]
23833#[derive(Debug, Clone, PartialEq)]
23834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23836#[cfg_attr(feature = "ts", derive(TS))]
23837#[cfg_attr(feature = "ts", ts(export))]
23838pub struct PARAM_REQUEST_LIST_DATA {
23839 #[doc = "System ID"]
23840 pub target_system: u8,
23841 #[doc = "Component ID"]
23842 pub target_component: u8,
23843}
23844impl PARAM_REQUEST_LIST_DATA {
23845 pub const ENCODED_LEN: usize = 2usize;
23846 pub const DEFAULT: Self = Self {
23847 target_system: 0_u8,
23848 target_component: 0_u8,
23849 };
23850 #[cfg(feature = "arbitrary")]
23851 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23852 use arbitrary::{Arbitrary, Unstructured};
23853 let mut buf = [0u8; 1024];
23854 rng.fill_bytes(&mut buf);
23855 let mut unstructured = Unstructured::new(&buf);
23856 Self::arbitrary(&mut unstructured).unwrap_or_default()
23857 }
23858}
23859impl Default for PARAM_REQUEST_LIST_DATA {
23860 fn default() -> Self {
23861 Self::DEFAULT.clone()
23862 }
23863}
23864impl MessageData for PARAM_REQUEST_LIST_DATA {
23865 type Message = MavMessage;
23866 const ID: u32 = 21u32;
23867 const NAME: &'static str = "PARAM_REQUEST_LIST";
23868 const EXTRA_CRC: u8 = 159u8;
23869 const ENCODED_LEN: usize = 2usize;
23870 fn deser(
23871 _version: MavlinkVersion,
23872 __input: &[u8],
23873 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23874 let avail_len = __input.len();
23875 let mut payload_buf = [0; Self::ENCODED_LEN];
23876 let mut buf = if avail_len < Self::ENCODED_LEN {
23877 payload_buf[0..avail_len].copy_from_slice(__input);
23878 Bytes::new(&payload_buf)
23879 } else {
23880 Bytes::new(__input)
23881 };
23882 let mut __struct = Self::default();
23883 __struct.target_system = buf.get_u8();
23884 __struct.target_component = buf.get_u8();
23885 Ok(__struct)
23886 }
23887 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23888 let mut __tmp = BytesMut::new(bytes);
23889 #[allow(clippy::absurd_extreme_comparisons)]
23890 #[allow(unused_comparisons)]
23891 if __tmp.remaining() < Self::ENCODED_LEN {
23892 panic!(
23893 "buffer is too small (need {} bytes, but got {})",
23894 Self::ENCODED_LEN,
23895 __tmp.remaining(),
23896 )
23897 }
23898 __tmp.put_u8(self.target_system);
23899 __tmp.put_u8(self.target_component);
23900 if matches!(version, MavlinkVersion::V2) {
23901 let len = __tmp.len();
23902 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23903 } else {
23904 __tmp.len()
23905 }
23906 }
23907}
23908#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23909#[doc = ""]
23910#[doc = "ID: 20"]
23911#[derive(Debug, Clone, PartialEq)]
23912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23914#[cfg_attr(feature = "ts", derive(TS))]
23915#[cfg_attr(feature = "ts", ts(export))]
23916pub struct PARAM_REQUEST_READ_DATA {
23917 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23918 pub param_index: i16,
23919 #[doc = "System ID"]
23920 pub target_system: u8,
23921 #[doc = "Component ID"]
23922 pub target_component: u8,
23923 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23924 #[cfg_attr(
23925 feature = "serde",
23926 serde(
23927 serialize_with = "crate::nulstr::serialize::<_, 16>",
23928 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
23929 )
23930 )]
23931 #[cfg_attr(feature = "ts", ts(type = "string"))]
23932 pub param_id: [u8; 16],
23933}
23934impl PARAM_REQUEST_READ_DATA {
23935 pub const ENCODED_LEN: usize = 20usize;
23936 pub const DEFAULT: Self = Self {
23937 param_index: 0_i16,
23938 target_system: 0_u8,
23939 target_component: 0_u8,
23940 param_id: [0_u8; 16usize],
23941 };
23942 #[cfg(feature = "arbitrary")]
23943 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23944 use arbitrary::{Arbitrary, Unstructured};
23945 let mut buf = [0u8; 1024];
23946 rng.fill_bytes(&mut buf);
23947 let mut unstructured = Unstructured::new(&buf);
23948 Self::arbitrary(&mut unstructured).unwrap_or_default()
23949 }
23950}
23951impl Default for PARAM_REQUEST_READ_DATA {
23952 fn default() -> Self {
23953 Self::DEFAULT.clone()
23954 }
23955}
23956impl MessageData for PARAM_REQUEST_READ_DATA {
23957 type Message = MavMessage;
23958 const ID: u32 = 20u32;
23959 const NAME: &'static str = "PARAM_REQUEST_READ";
23960 const EXTRA_CRC: u8 = 214u8;
23961 const ENCODED_LEN: usize = 20usize;
23962 fn deser(
23963 _version: MavlinkVersion,
23964 __input: &[u8],
23965 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23966 let avail_len = __input.len();
23967 let mut payload_buf = [0; Self::ENCODED_LEN];
23968 let mut buf = if avail_len < Self::ENCODED_LEN {
23969 payload_buf[0..avail_len].copy_from_slice(__input);
23970 Bytes::new(&payload_buf)
23971 } else {
23972 Bytes::new(__input)
23973 };
23974 let mut __struct = Self::default();
23975 __struct.param_index = buf.get_i16_le();
23976 __struct.target_system = buf.get_u8();
23977 __struct.target_component = buf.get_u8();
23978 for v in &mut __struct.param_id {
23979 let val = buf.get_u8();
23980 *v = val;
23981 }
23982 Ok(__struct)
23983 }
23984 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23985 let mut __tmp = BytesMut::new(bytes);
23986 #[allow(clippy::absurd_extreme_comparisons)]
23987 #[allow(unused_comparisons)]
23988 if __tmp.remaining() < Self::ENCODED_LEN {
23989 panic!(
23990 "buffer is too small (need {} bytes, but got {})",
23991 Self::ENCODED_LEN,
23992 __tmp.remaining(),
23993 )
23994 }
23995 __tmp.put_i16_le(self.param_index);
23996 __tmp.put_u8(self.target_system);
23997 __tmp.put_u8(self.target_component);
23998 for val in &self.param_id {
23999 __tmp.put_u8(*val);
24000 }
24001 if matches!(version, MavlinkVersion::V2) {
24002 let len = __tmp.len();
24003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24004 } else {
24005 __tmp.len()
24006 }
24007 }
24008}
24009#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24010#[doc = ""]
24011#[doc = "ID: 23"]
24012#[derive(Debug, Clone, PartialEq)]
24013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24015#[cfg_attr(feature = "ts", derive(TS))]
24016#[cfg_attr(feature = "ts", ts(export))]
24017pub struct PARAM_SET_DATA {
24018 #[doc = "Onboard parameter value"]
24019 pub param_value: f32,
24020 #[doc = "System ID"]
24021 pub target_system: u8,
24022 #[doc = "Component ID"]
24023 pub target_component: u8,
24024 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24025 #[cfg_attr(
24026 feature = "serde",
24027 serde(
24028 serialize_with = "crate::nulstr::serialize::<_, 16>",
24029 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24030 )
24031 )]
24032 #[cfg_attr(feature = "ts", ts(type = "string"))]
24033 pub param_id: [u8; 16],
24034 #[doc = "Onboard parameter type."]
24035 pub param_type: MavParamType,
24036}
24037impl PARAM_SET_DATA {
24038 pub const ENCODED_LEN: usize = 23usize;
24039 pub const DEFAULT: Self = Self {
24040 param_value: 0.0_f32,
24041 target_system: 0_u8,
24042 target_component: 0_u8,
24043 param_id: [0_u8; 16usize],
24044 param_type: MavParamType::DEFAULT,
24045 };
24046 #[cfg(feature = "arbitrary")]
24047 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24048 use arbitrary::{Arbitrary, Unstructured};
24049 let mut buf = [0u8; 1024];
24050 rng.fill_bytes(&mut buf);
24051 let mut unstructured = Unstructured::new(&buf);
24052 Self::arbitrary(&mut unstructured).unwrap_or_default()
24053 }
24054}
24055impl Default for PARAM_SET_DATA {
24056 fn default() -> Self {
24057 Self::DEFAULT.clone()
24058 }
24059}
24060impl MessageData for PARAM_SET_DATA {
24061 type Message = MavMessage;
24062 const ID: u32 = 23u32;
24063 const NAME: &'static str = "PARAM_SET";
24064 const EXTRA_CRC: u8 = 168u8;
24065 const ENCODED_LEN: usize = 23usize;
24066 fn deser(
24067 _version: MavlinkVersion,
24068 __input: &[u8],
24069 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24070 let avail_len = __input.len();
24071 let mut payload_buf = [0; Self::ENCODED_LEN];
24072 let mut buf = if avail_len < Self::ENCODED_LEN {
24073 payload_buf[0..avail_len].copy_from_slice(__input);
24074 Bytes::new(&payload_buf)
24075 } else {
24076 Bytes::new(__input)
24077 };
24078 let mut __struct = Self::default();
24079 __struct.param_value = buf.get_f32_le();
24080 __struct.target_system = buf.get_u8();
24081 __struct.target_component = buf.get_u8();
24082 for v in &mut __struct.param_id {
24083 let val = buf.get_u8();
24084 *v = val;
24085 }
24086 let tmp = buf.get_u8();
24087 __struct.param_type =
24088 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24089 enum_type: "MavParamType",
24090 value: tmp as u32,
24091 })?;
24092 Ok(__struct)
24093 }
24094 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24095 let mut __tmp = BytesMut::new(bytes);
24096 #[allow(clippy::absurd_extreme_comparisons)]
24097 #[allow(unused_comparisons)]
24098 if __tmp.remaining() < Self::ENCODED_LEN {
24099 panic!(
24100 "buffer is too small (need {} bytes, but got {})",
24101 Self::ENCODED_LEN,
24102 __tmp.remaining(),
24103 )
24104 }
24105 __tmp.put_f32_le(self.param_value);
24106 __tmp.put_u8(self.target_system);
24107 __tmp.put_u8(self.target_component);
24108 for val in &self.param_id {
24109 __tmp.put_u8(*val);
24110 }
24111 __tmp.put_u8(self.param_type as u8);
24112 if matches!(version, MavlinkVersion::V2) {
24113 let len = __tmp.len();
24114 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24115 } else {
24116 __tmp.len()
24117 }
24118 }
24119}
24120#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24121#[doc = ""]
24122#[doc = "ID: 22"]
24123#[derive(Debug, Clone, PartialEq)]
24124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24126#[cfg_attr(feature = "ts", derive(TS))]
24127#[cfg_attr(feature = "ts", ts(export))]
24128pub struct PARAM_VALUE_DATA {
24129 #[doc = "Onboard parameter value"]
24130 pub param_value: f32,
24131 #[doc = "Total number of onboard parameters"]
24132 pub param_count: u16,
24133 #[doc = "Index of this onboard parameter"]
24134 pub param_index: u16,
24135 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24136 #[cfg_attr(
24137 feature = "serde",
24138 serde(
24139 serialize_with = "crate::nulstr::serialize::<_, 16>",
24140 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
24141 )
24142 )]
24143 #[cfg_attr(feature = "ts", ts(type = "string"))]
24144 pub param_id: [u8; 16],
24145 #[doc = "Onboard parameter type."]
24146 pub param_type: MavParamType,
24147}
24148impl PARAM_VALUE_DATA {
24149 pub const ENCODED_LEN: usize = 25usize;
24150 pub const DEFAULT: Self = Self {
24151 param_value: 0.0_f32,
24152 param_count: 0_u16,
24153 param_index: 0_u16,
24154 param_id: [0_u8; 16usize],
24155 param_type: MavParamType::DEFAULT,
24156 };
24157 #[cfg(feature = "arbitrary")]
24158 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24159 use arbitrary::{Arbitrary, Unstructured};
24160 let mut buf = [0u8; 1024];
24161 rng.fill_bytes(&mut buf);
24162 let mut unstructured = Unstructured::new(&buf);
24163 Self::arbitrary(&mut unstructured).unwrap_or_default()
24164 }
24165}
24166impl Default for PARAM_VALUE_DATA {
24167 fn default() -> Self {
24168 Self::DEFAULT.clone()
24169 }
24170}
24171impl MessageData for PARAM_VALUE_DATA {
24172 type Message = MavMessage;
24173 const ID: u32 = 22u32;
24174 const NAME: &'static str = "PARAM_VALUE";
24175 const EXTRA_CRC: u8 = 220u8;
24176 const ENCODED_LEN: usize = 25usize;
24177 fn deser(
24178 _version: MavlinkVersion,
24179 __input: &[u8],
24180 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24181 let avail_len = __input.len();
24182 let mut payload_buf = [0; Self::ENCODED_LEN];
24183 let mut buf = if avail_len < Self::ENCODED_LEN {
24184 payload_buf[0..avail_len].copy_from_slice(__input);
24185 Bytes::new(&payload_buf)
24186 } else {
24187 Bytes::new(__input)
24188 };
24189 let mut __struct = Self::default();
24190 __struct.param_value = buf.get_f32_le();
24191 __struct.param_count = buf.get_u16_le();
24192 __struct.param_index = buf.get_u16_le();
24193 for v in &mut __struct.param_id {
24194 let val = buf.get_u8();
24195 *v = val;
24196 }
24197 let tmp = buf.get_u8();
24198 __struct.param_type =
24199 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24200 enum_type: "MavParamType",
24201 value: tmp as u32,
24202 })?;
24203 Ok(__struct)
24204 }
24205 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24206 let mut __tmp = BytesMut::new(bytes);
24207 #[allow(clippy::absurd_extreme_comparisons)]
24208 #[allow(unused_comparisons)]
24209 if __tmp.remaining() < Self::ENCODED_LEN {
24210 panic!(
24211 "buffer is too small (need {} bytes, but got {})",
24212 Self::ENCODED_LEN,
24213 __tmp.remaining(),
24214 )
24215 }
24216 __tmp.put_f32_le(self.param_value);
24217 __tmp.put_u16_le(self.param_count);
24218 __tmp.put_u16_le(self.param_index);
24219 for val in &self.param_id {
24220 __tmp.put_u8(*val);
24221 }
24222 __tmp.put_u8(self.param_type as u8);
24223 if matches!(version, MavlinkVersion::V2) {
24224 let len = __tmp.len();
24225 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24226 } else {
24227 __tmp.len()
24228 }
24229 }
24230}
24231#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24232#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24233#[doc = ""]
24234#[doc = "ID: 4"]
24235#[derive(Debug, Clone, PartialEq)]
24236#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24237#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24238#[cfg_attr(feature = "ts", derive(TS))]
24239#[cfg_attr(feature = "ts", ts(export))]
24240pub struct PING_DATA {
24241 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24242 pub time_usec: u64,
24243 #[doc = "PING sequence"]
24244 pub seq: u32,
24245 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24246 pub target_system: u8,
24247 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24248 pub target_component: u8,
24249}
24250impl PING_DATA {
24251 pub const ENCODED_LEN: usize = 14usize;
24252 pub const DEFAULT: Self = Self {
24253 time_usec: 0_u64,
24254 seq: 0_u32,
24255 target_system: 0_u8,
24256 target_component: 0_u8,
24257 };
24258 #[cfg(feature = "arbitrary")]
24259 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24260 use arbitrary::{Arbitrary, Unstructured};
24261 let mut buf = [0u8; 1024];
24262 rng.fill_bytes(&mut buf);
24263 let mut unstructured = Unstructured::new(&buf);
24264 Self::arbitrary(&mut unstructured).unwrap_or_default()
24265 }
24266}
24267impl Default for PING_DATA {
24268 fn default() -> Self {
24269 Self::DEFAULT.clone()
24270 }
24271}
24272impl MessageData for PING_DATA {
24273 type Message = MavMessage;
24274 const ID: u32 = 4u32;
24275 const NAME: &'static str = "PING";
24276 const EXTRA_CRC: u8 = 237u8;
24277 const ENCODED_LEN: usize = 14usize;
24278 fn deser(
24279 _version: MavlinkVersion,
24280 __input: &[u8],
24281 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24282 let avail_len = __input.len();
24283 let mut payload_buf = [0; Self::ENCODED_LEN];
24284 let mut buf = if avail_len < Self::ENCODED_LEN {
24285 payload_buf[0..avail_len].copy_from_slice(__input);
24286 Bytes::new(&payload_buf)
24287 } else {
24288 Bytes::new(__input)
24289 };
24290 let mut __struct = Self::default();
24291 __struct.time_usec = buf.get_u64_le();
24292 __struct.seq = buf.get_u32_le();
24293 __struct.target_system = buf.get_u8();
24294 __struct.target_component = buf.get_u8();
24295 Ok(__struct)
24296 }
24297 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24298 let mut __tmp = BytesMut::new(bytes);
24299 #[allow(clippy::absurd_extreme_comparisons)]
24300 #[allow(unused_comparisons)]
24301 if __tmp.remaining() < Self::ENCODED_LEN {
24302 panic!(
24303 "buffer is too small (need {} bytes, but got {})",
24304 Self::ENCODED_LEN,
24305 __tmp.remaining(),
24306 )
24307 }
24308 __tmp.put_u64_le(self.time_usec);
24309 __tmp.put_u32_le(self.seq);
24310 __tmp.put_u8(self.target_system);
24311 __tmp.put_u8(self.target_component);
24312 if matches!(version, MavlinkVersion::V2) {
24313 let len = __tmp.len();
24314 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24315 } else {
24316 __tmp.len()
24317 }
24318 }
24319}
24320#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24321#[doc = "Control vehicle tone generation (buzzer)."]
24322#[doc = ""]
24323#[doc = "ID: 258"]
24324#[derive(Debug, Clone, PartialEq)]
24325#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24326#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24327#[cfg_attr(feature = "ts", derive(TS))]
24328#[cfg_attr(feature = "ts", ts(export))]
24329pub struct PLAY_TUNE_DATA {
24330 #[doc = "System ID"]
24331 pub target_system: u8,
24332 #[doc = "Component ID"]
24333 pub target_component: u8,
24334 #[doc = "tune in board specific format"]
24335 #[cfg_attr(
24336 feature = "serde",
24337 serde(
24338 serialize_with = "crate::nulstr::serialize::<_, 30>",
24339 deserialize_with = "crate::nulstr::deserialize::<_, 30>"
24340 )
24341 )]
24342 #[cfg_attr(feature = "ts", ts(type = "string"))]
24343 pub tune: [u8; 30],
24344 #[doc = "tune extension (appended to tune)"]
24345 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24346 #[cfg_attr(
24347 feature = "serde",
24348 serde(
24349 serialize_with = "crate::nulstr::serialize::<_, 200>",
24350 deserialize_with = "crate::nulstr::deserialize::<_, 200>"
24351 )
24352 )]
24353 #[cfg_attr(feature = "ts", ts(type = "string"))]
24354 pub tune2: [u8; 200],
24355}
24356impl PLAY_TUNE_DATA {
24357 pub const ENCODED_LEN: usize = 232usize;
24358 pub const DEFAULT: Self = Self {
24359 target_system: 0_u8,
24360 target_component: 0_u8,
24361 tune: [0_u8; 30usize],
24362 tune2: [0_u8; 200usize],
24363 };
24364 #[cfg(feature = "arbitrary")]
24365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24366 use arbitrary::{Arbitrary, Unstructured};
24367 let mut buf = [0u8; 1024];
24368 rng.fill_bytes(&mut buf);
24369 let mut unstructured = Unstructured::new(&buf);
24370 Self::arbitrary(&mut unstructured).unwrap_or_default()
24371 }
24372}
24373impl Default for PLAY_TUNE_DATA {
24374 fn default() -> Self {
24375 Self::DEFAULT.clone()
24376 }
24377}
24378impl MessageData for PLAY_TUNE_DATA {
24379 type Message = MavMessage;
24380 const ID: u32 = 258u32;
24381 const NAME: &'static str = "PLAY_TUNE";
24382 const EXTRA_CRC: u8 = 187u8;
24383 const ENCODED_LEN: usize = 232usize;
24384 fn deser(
24385 _version: MavlinkVersion,
24386 __input: &[u8],
24387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24388 let avail_len = __input.len();
24389 let mut payload_buf = [0; Self::ENCODED_LEN];
24390 let mut buf = if avail_len < Self::ENCODED_LEN {
24391 payload_buf[0..avail_len].copy_from_slice(__input);
24392 Bytes::new(&payload_buf)
24393 } else {
24394 Bytes::new(__input)
24395 };
24396 let mut __struct = Self::default();
24397 __struct.target_system = buf.get_u8();
24398 __struct.target_component = buf.get_u8();
24399 for v in &mut __struct.tune {
24400 let val = buf.get_u8();
24401 *v = val;
24402 }
24403 for v in &mut __struct.tune2 {
24404 let val = buf.get_u8();
24405 *v = val;
24406 }
24407 Ok(__struct)
24408 }
24409 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24410 let mut __tmp = BytesMut::new(bytes);
24411 #[allow(clippy::absurd_extreme_comparisons)]
24412 #[allow(unused_comparisons)]
24413 if __tmp.remaining() < Self::ENCODED_LEN {
24414 panic!(
24415 "buffer is too small (need {} bytes, but got {})",
24416 Self::ENCODED_LEN,
24417 __tmp.remaining(),
24418 )
24419 }
24420 __tmp.put_u8(self.target_system);
24421 __tmp.put_u8(self.target_component);
24422 for val in &self.tune {
24423 __tmp.put_u8(*val);
24424 }
24425 if matches!(version, MavlinkVersion::V2) {
24426 for val in &self.tune2 {
24427 __tmp.put_u8(*val);
24428 }
24429 let len = __tmp.len();
24430 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24431 } else {
24432 __tmp.len()
24433 }
24434 }
24435}
24436#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24437#[doc = ""]
24438#[doc = "ID: 400"]
24439#[derive(Debug, Clone, PartialEq)]
24440#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24441#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24442#[cfg_attr(feature = "ts", derive(TS))]
24443#[cfg_attr(feature = "ts", ts(export))]
24444pub struct PLAY_TUNE_V2_DATA {
24445 #[doc = "Tune format"]
24446 pub format: TuneFormat,
24447 #[doc = "System ID"]
24448 pub target_system: u8,
24449 #[doc = "Component ID"]
24450 pub target_component: u8,
24451 #[doc = "Tune definition as a NULL-terminated string."]
24452 #[cfg_attr(
24453 feature = "serde",
24454 serde(
24455 serialize_with = "crate::nulstr::serialize::<_, 248>",
24456 deserialize_with = "crate::nulstr::deserialize::<_, 248>"
24457 )
24458 )]
24459 #[cfg_attr(feature = "ts", ts(type = "string"))]
24460 pub tune: [u8; 248],
24461}
24462impl PLAY_TUNE_V2_DATA {
24463 pub const ENCODED_LEN: usize = 254usize;
24464 pub const DEFAULT: Self = Self {
24465 format: TuneFormat::DEFAULT,
24466 target_system: 0_u8,
24467 target_component: 0_u8,
24468 tune: [0_u8; 248usize],
24469 };
24470 #[cfg(feature = "arbitrary")]
24471 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24472 use arbitrary::{Arbitrary, Unstructured};
24473 let mut buf = [0u8; 1024];
24474 rng.fill_bytes(&mut buf);
24475 let mut unstructured = Unstructured::new(&buf);
24476 Self::arbitrary(&mut unstructured).unwrap_or_default()
24477 }
24478}
24479impl Default for PLAY_TUNE_V2_DATA {
24480 fn default() -> Self {
24481 Self::DEFAULT.clone()
24482 }
24483}
24484impl MessageData for PLAY_TUNE_V2_DATA {
24485 type Message = MavMessage;
24486 const ID: u32 = 400u32;
24487 const NAME: &'static str = "PLAY_TUNE_V2";
24488 const EXTRA_CRC: u8 = 110u8;
24489 const ENCODED_LEN: usize = 254usize;
24490 fn deser(
24491 _version: MavlinkVersion,
24492 __input: &[u8],
24493 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24494 let avail_len = __input.len();
24495 let mut payload_buf = [0; Self::ENCODED_LEN];
24496 let mut buf = if avail_len < Self::ENCODED_LEN {
24497 payload_buf[0..avail_len].copy_from_slice(__input);
24498 Bytes::new(&payload_buf)
24499 } else {
24500 Bytes::new(__input)
24501 };
24502 let mut __struct = Self::default();
24503 let tmp = buf.get_u32_le();
24504 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24505 ::mavlink_core::error::ParserError::InvalidEnum {
24506 enum_type: "TuneFormat",
24507 value: tmp as u32,
24508 },
24509 )?;
24510 __struct.target_system = buf.get_u8();
24511 __struct.target_component = buf.get_u8();
24512 for v in &mut __struct.tune {
24513 let val = buf.get_u8();
24514 *v = val;
24515 }
24516 Ok(__struct)
24517 }
24518 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24519 let mut __tmp = BytesMut::new(bytes);
24520 #[allow(clippy::absurd_extreme_comparisons)]
24521 #[allow(unused_comparisons)]
24522 if __tmp.remaining() < Self::ENCODED_LEN {
24523 panic!(
24524 "buffer is too small (need {} bytes, but got {})",
24525 Self::ENCODED_LEN,
24526 __tmp.remaining(),
24527 )
24528 }
24529 __tmp.put_u32_le(self.format as u32);
24530 __tmp.put_u8(self.target_system);
24531 __tmp.put_u8(self.target_component);
24532 for val in &self.tune {
24533 __tmp.put_u8(*val);
24534 }
24535 if matches!(version, MavlinkVersion::V2) {
24536 let len = __tmp.len();
24537 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24538 } else {
24539 __tmp.len()
24540 }
24541 }
24542}
24543#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24544#[doc = ""]
24545#[doc = "ID: 87"]
24546#[derive(Debug, Clone, PartialEq)]
24547#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24549#[cfg_attr(feature = "ts", derive(TS))]
24550#[cfg_attr(feature = "ts", ts(export))]
24551pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24552 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24553 pub time_boot_ms: u32,
24554 #[doc = "Latitude in WGS84 frame"]
24555 pub lat_int: i32,
24556 #[doc = "Longitude in WGS84 frame"]
24557 pub lon_int: i32,
24558 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24559 pub alt: f32,
24560 #[doc = "X velocity in NED frame"]
24561 pub vx: f32,
24562 #[doc = "Y velocity in NED frame"]
24563 pub vy: f32,
24564 #[doc = "Z velocity in NED frame"]
24565 pub vz: f32,
24566 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24567 pub afx: f32,
24568 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24569 pub afy: f32,
24570 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24571 pub afz: f32,
24572 #[doc = "yaw setpoint"]
24573 pub yaw: f32,
24574 #[doc = "yaw rate setpoint"]
24575 pub yaw_rate: f32,
24576 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24577 pub type_mask: PositionTargetTypemask,
24578 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24579 pub coordinate_frame: MavFrame,
24580}
24581impl POSITION_TARGET_GLOBAL_INT_DATA {
24582 pub const ENCODED_LEN: usize = 51usize;
24583 pub const DEFAULT: Self = Self {
24584 time_boot_ms: 0_u32,
24585 lat_int: 0_i32,
24586 lon_int: 0_i32,
24587 alt: 0.0_f32,
24588 vx: 0.0_f32,
24589 vy: 0.0_f32,
24590 vz: 0.0_f32,
24591 afx: 0.0_f32,
24592 afy: 0.0_f32,
24593 afz: 0.0_f32,
24594 yaw: 0.0_f32,
24595 yaw_rate: 0.0_f32,
24596 type_mask: PositionTargetTypemask::DEFAULT,
24597 coordinate_frame: MavFrame::DEFAULT,
24598 };
24599 #[cfg(feature = "arbitrary")]
24600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24601 use arbitrary::{Arbitrary, Unstructured};
24602 let mut buf = [0u8; 1024];
24603 rng.fill_bytes(&mut buf);
24604 let mut unstructured = Unstructured::new(&buf);
24605 Self::arbitrary(&mut unstructured).unwrap_or_default()
24606 }
24607}
24608impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24609 fn default() -> Self {
24610 Self::DEFAULT.clone()
24611 }
24612}
24613impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24614 type Message = MavMessage;
24615 const ID: u32 = 87u32;
24616 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24617 const EXTRA_CRC: u8 = 150u8;
24618 const ENCODED_LEN: usize = 51usize;
24619 fn deser(
24620 _version: MavlinkVersion,
24621 __input: &[u8],
24622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24623 let avail_len = __input.len();
24624 let mut payload_buf = [0; Self::ENCODED_LEN];
24625 let mut buf = if avail_len < Self::ENCODED_LEN {
24626 payload_buf[0..avail_len].copy_from_slice(__input);
24627 Bytes::new(&payload_buf)
24628 } else {
24629 Bytes::new(__input)
24630 };
24631 let mut __struct = Self::default();
24632 __struct.time_boot_ms = buf.get_u32_le();
24633 __struct.lat_int = buf.get_i32_le();
24634 __struct.lon_int = buf.get_i32_le();
24635 __struct.alt = buf.get_f32_le();
24636 __struct.vx = buf.get_f32_le();
24637 __struct.vy = buf.get_f32_le();
24638 __struct.vz = buf.get_f32_le();
24639 __struct.afx = buf.get_f32_le();
24640 __struct.afy = buf.get_f32_le();
24641 __struct.afz = buf.get_f32_le();
24642 __struct.yaw = buf.get_f32_le();
24643 __struct.yaw_rate = buf.get_f32_le();
24644 let tmp = buf.get_u16_le();
24645 __struct.type_mask = PositionTargetTypemask::from_bits(
24646 tmp & PositionTargetTypemask::all().bits(),
24647 )
24648 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24649 flag_type: "PositionTargetTypemask",
24650 value: tmp as u32,
24651 })?;
24652 let tmp = buf.get_u8();
24653 __struct.coordinate_frame =
24654 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24655 enum_type: "MavFrame",
24656 value: tmp as u32,
24657 })?;
24658 Ok(__struct)
24659 }
24660 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24661 let mut __tmp = BytesMut::new(bytes);
24662 #[allow(clippy::absurd_extreme_comparisons)]
24663 #[allow(unused_comparisons)]
24664 if __tmp.remaining() < Self::ENCODED_LEN {
24665 panic!(
24666 "buffer is too small (need {} bytes, but got {})",
24667 Self::ENCODED_LEN,
24668 __tmp.remaining(),
24669 )
24670 }
24671 __tmp.put_u32_le(self.time_boot_ms);
24672 __tmp.put_i32_le(self.lat_int);
24673 __tmp.put_i32_le(self.lon_int);
24674 __tmp.put_f32_le(self.alt);
24675 __tmp.put_f32_le(self.vx);
24676 __tmp.put_f32_le(self.vy);
24677 __tmp.put_f32_le(self.vz);
24678 __tmp.put_f32_le(self.afx);
24679 __tmp.put_f32_le(self.afy);
24680 __tmp.put_f32_le(self.afz);
24681 __tmp.put_f32_le(self.yaw);
24682 __tmp.put_f32_le(self.yaw_rate);
24683 __tmp.put_u16_le(self.type_mask.bits());
24684 __tmp.put_u8(self.coordinate_frame as u8);
24685 if matches!(version, MavlinkVersion::V2) {
24686 let len = __tmp.len();
24687 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24688 } else {
24689 __tmp.len()
24690 }
24691 }
24692}
24693#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24694#[doc = ""]
24695#[doc = "ID: 85"]
24696#[derive(Debug, Clone, PartialEq)]
24697#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24698#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24699#[cfg_attr(feature = "ts", derive(TS))]
24700#[cfg_attr(feature = "ts", ts(export))]
24701pub struct POSITION_TARGET_LOCAL_NED_DATA {
24702 #[doc = "Timestamp (time since system boot)."]
24703 pub time_boot_ms: u32,
24704 #[doc = "X Position in NED frame"]
24705 pub x: f32,
24706 #[doc = "Y Position in NED frame"]
24707 pub y: f32,
24708 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24709 pub z: f32,
24710 #[doc = "X velocity in NED frame"]
24711 pub vx: f32,
24712 #[doc = "Y velocity in NED frame"]
24713 pub vy: f32,
24714 #[doc = "Z velocity in NED frame"]
24715 pub vz: f32,
24716 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24717 pub afx: f32,
24718 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24719 pub afy: f32,
24720 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24721 pub afz: f32,
24722 #[doc = "yaw setpoint"]
24723 pub yaw: f32,
24724 #[doc = "yaw rate setpoint"]
24725 pub yaw_rate: f32,
24726 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24727 pub type_mask: PositionTargetTypemask,
24728 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24729 pub coordinate_frame: MavFrame,
24730}
24731impl POSITION_TARGET_LOCAL_NED_DATA {
24732 pub const ENCODED_LEN: usize = 51usize;
24733 pub const DEFAULT: Self = Self {
24734 time_boot_ms: 0_u32,
24735 x: 0.0_f32,
24736 y: 0.0_f32,
24737 z: 0.0_f32,
24738 vx: 0.0_f32,
24739 vy: 0.0_f32,
24740 vz: 0.0_f32,
24741 afx: 0.0_f32,
24742 afy: 0.0_f32,
24743 afz: 0.0_f32,
24744 yaw: 0.0_f32,
24745 yaw_rate: 0.0_f32,
24746 type_mask: PositionTargetTypemask::DEFAULT,
24747 coordinate_frame: MavFrame::DEFAULT,
24748 };
24749 #[cfg(feature = "arbitrary")]
24750 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24751 use arbitrary::{Arbitrary, Unstructured};
24752 let mut buf = [0u8; 1024];
24753 rng.fill_bytes(&mut buf);
24754 let mut unstructured = Unstructured::new(&buf);
24755 Self::arbitrary(&mut unstructured).unwrap_or_default()
24756 }
24757}
24758impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24759 fn default() -> Self {
24760 Self::DEFAULT.clone()
24761 }
24762}
24763impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24764 type Message = MavMessage;
24765 const ID: u32 = 85u32;
24766 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24767 const EXTRA_CRC: u8 = 140u8;
24768 const ENCODED_LEN: usize = 51usize;
24769 fn deser(
24770 _version: MavlinkVersion,
24771 __input: &[u8],
24772 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24773 let avail_len = __input.len();
24774 let mut payload_buf = [0; Self::ENCODED_LEN];
24775 let mut buf = if avail_len < Self::ENCODED_LEN {
24776 payload_buf[0..avail_len].copy_from_slice(__input);
24777 Bytes::new(&payload_buf)
24778 } else {
24779 Bytes::new(__input)
24780 };
24781 let mut __struct = Self::default();
24782 __struct.time_boot_ms = buf.get_u32_le();
24783 __struct.x = buf.get_f32_le();
24784 __struct.y = buf.get_f32_le();
24785 __struct.z = buf.get_f32_le();
24786 __struct.vx = buf.get_f32_le();
24787 __struct.vy = buf.get_f32_le();
24788 __struct.vz = buf.get_f32_le();
24789 __struct.afx = buf.get_f32_le();
24790 __struct.afy = buf.get_f32_le();
24791 __struct.afz = buf.get_f32_le();
24792 __struct.yaw = buf.get_f32_le();
24793 __struct.yaw_rate = buf.get_f32_le();
24794 let tmp = buf.get_u16_le();
24795 __struct.type_mask = PositionTargetTypemask::from_bits(
24796 tmp & PositionTargetTypemask::all().bits(),
24797 )
24798 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24799 flag_type: "PositionTargetTypemask",
24800 value: tmp as u32,
24801 })?;
24802 let tmp = buf.get_u8();
24803 __struct.coordinate_frame =
24804 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24805 enum_type: "MavFrame",
24806 value: tmp as u32,
24807 })?;
24808 Ok(__struct)
24809 }
24810 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24811 let mut __tmp = BytesMut::new(bytes);
24812 #[allow(clippy::absurd_extreme_comparisons)]
24813 #[allow(unused_comparisons)]
24814 if __tmp.remaining() < Self::ENCODED_LEN {
24815 panic!(
24816 "buffer is too small (need {} bytes, but got {})",
24817 Self::ENCODED_LEN,
24818 __tmp.remaining(),
24819 )
24820 }
24821 __tmp.put_u32_le(self.time_boot_ms);
24822 __tmp.put_f32_le(self.x);
24823 __tmp.put_f32_le(self.y);
24824 __tmp.put_f32_le(self.z);
24825 __tmp.put_f32_le(self.vx);
24826 __tmp.put_f32_le(self.vy);
24827 __tmp.put_f32_le(self.vz);
24828 __tmp.put_f32_le(self.afx);
24829 __tmp.put_f32_le(self.afy);
24830 __tmp.put_f32_le(self.afz);
24831 __tmp.put_f32_le(self.yaw);
24832 __tmp.put_f32_le(self.yaw_rate);
24833 __tmp.put_u16_le(self.type_mask.bits());
24834 __tmp.put_u8(self.coordinate_frame as u8);
24835 if matches!(version, MavlinkVersion::V2) {
24836 let len = __tmp.len();
24837 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24838 } else {
24839 __tmp.len()
24840 }
24841 }
24842}
24843#[doc = "Power supply status."]
24844#[doc = ""]
24845#[doc = "ID: 125"]
24846#[derive(Debug, Clone, PartialEq)]
24847#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24849#[cfg_attr(feature = "ts", derive(TS))]
24850#[cfg_attr(feature = "ts", ts(export))]
24851pub struct POWER_STATUS_DATA {
24852 #[doc = "5V rail voltage."]
24853 pub Vcc: u16,
24854 #[doc = "Servo rail voltage."]
24855 pub Vservo: u16,
24856 #[doc = "Bitmap of power supply status flags."]
24857 pub flags: MavPowerStatus,
24858}
24859impl POWER_STATUS_DATA {
24860 pub const ENCODED_LEN: usize = 6usize;
24861 pub const DEFAULT: Self = Self {
24862 Vcc: 0_u16,
24863 Vservo: 0_u16,
24864 flags: MavPowerStatus::DEFAULT,
24865 };
24866 #[cfg(feature = "arbitrary")]
24867 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24868 use arbitrary::{Arbitrary, Unstructured};
24869 let mut buf = [0u8; 1024];
24870 rng.fill_bytes(&mut buf);
24871 let mut unstructured = Unstructured::new(&buf);
24872 Self::arbitrary(&mut unstructured).unwrap_or_default()
24873 }
24874}
24875impl Default for POWER_STATUS_DATA {
24876 fn default() -> Self {
24877 Self::DEFAULT.clone()
24878 }
24879}
24880impl MessageData for POWER_STATUS_DATA {
24881 type Message = MavMessage;
24882 const ID: u32 = 125u32;
24883 const NAME: &'static str = "POWER_STATUS";
24884 const EXTRA_CRC: u8 = 203u8;
24885 const ENCODED_LEN: usize = 6usize;
24886 fn deser(
24887 _version: MavlinkVersion,
24888 __input: &[u8],
24889 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24890 let avail_len = __input.len();
24891 let mut payload_buf = [0; Self::ENCODED_LEN];
24892 let mut buf = if avail_len < Self::ENCODED_LEN {
24893 payload_buf[0..avail_len].copy_from_slice(__input);
24894 Bytes::new(&payload_buf)
24895 } else {
24896 Bytes::new(__input)
24897 };
24898 let mut __struct = Self::default();
24899 __struct.Vcc = buf.get_u16_le();
24900 __struct.Vservo = buf.get_u16_le();
24901 let tmp = buf.get_u16_le();
24902 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
24903 ::mavlink_core::error::ParserError::InvalidFlag {
24904 flag_type: "MavPowerStatus",
24905 value: tmp as u32,
24906 },
24907 )?;
24908 Ok(__struct)
24909 }
24910 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24911 let mut __tmp = BytesMut::new(bytes);
24912 #[allow(clippy::absurd_extreme_comparisons)]
24913 #[allow(unused_comparisons)]
24914 if __tmp.remaining() < Self::ENCODED_LEN {
24915 panic!(
24916 "buffer is too small (need {} bytes, but got {})",
24917 Self::ENCODED_LEN,
24918 __tmp.remaining(),
24919 )
24920 }
24921 __tmp.put_u16_le(self.Vcc);
24922 __tmp.put_u16_le(self.Vservo);
24923 __tmp.put_u16_le(self.flags.bits());
24924 if matches!(version, MavlinkVersion::V2) {
24925 let len = __tmp.len();
24926 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24927 } else {
24928 __tmp.len()
24929 }
24930 }
24931}
24932#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24933#[doc = ""]
24934#[doc = "ID: 300"]
24935#[derive(Debug, Clone, PartialEq)]
24936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24937#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24938#[cfg_attr(feature = "ts", derive(TS))]
24939#[cfg_attr(feature = "ts", ts(export))]
24940pub struct PROTOCOL_VERSION_DATA {
24941 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24942 pub version: u16,
24943 #[doc = "Minimum MAVLink version supported"]
24944 pub min_version: u16,
24945 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24946 pub max_version: u16,
24947 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24948 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24949 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24950 pub spec_version_hash: [u8; 8],
24951 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24952 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24953 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24954 pub library_version_hash: [u8; 8],
24955}
24956impl PROTOCOL_VERSION_DATA {
24957 pub const ENCODED_LEN: usize = 22usize;
24958 pub const DEFAULT: Self = Self {
24959 version: 0_u16,
24960 min_version: 0_u16,
24961 max_version: 0_u16,
24962 spec_version_hash: [0_u8; 8usize],
24963 library_version_hash: [0_u8; 8usize],
24964 };
24965 #[cfg(feature = "arbitrary")]
24966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24967 use arbitrary::{Arbitrary, Unstructured};
24968 let mut buf = [0u8; 1024];
24969 rng.fill_bytes(&mut buf);
24970 let mut unstructured = Unstructured::new(&buf);
24971 Self::arbitrary(&mut unstructured).unwrap_or_default()
24972 }
24973}
24974impl Default for PROTOCOL_VERSION_DATA {
24975 fn default() -> Self {
24976 Self::DEFAULT.clone()
24977 }
24978}
24979impl MessageData for PROTOCOL_VERSION_DATA {
24980 type Message = MavMessage;
24981 const ID: u32 = 300u32;
24982 const NAME: &'static str = "PROTOCOL_VERSION";
24983 const EXTRA_CRC: u8 = 217u8;
24984 const ENCODED_LEN: usize = 22usize;
24985 fn deser(
24986 _version: MavlinkVersion,
24987 __input: &[u8],
24988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24989 let avail_len = __input.len();
24990 let mut payload_buf = [0; Self::ENCODED_LEN];
24991 let mut buf = if avail_len < Self::ENCODED_LEN {
24992 payload_buf[0..avail_len].copy_from_slice(__input);
24993 Bytes::new(&payload_buf)
24994 } else {
24995 Bytes::new(__input)
24996 };
24997 let mut __struct = Self::default();
24998 __struct.version = buf.get_u16_le();
24999 __struct.min_version = buf.get_u16_le();
25000 __struct.max_version = buf.get_u16_le();
25001 for v in &mut __struct.spec_version_hash {
25002 let val = buf.get_u8();
25003 *v = val;
25004 }
25005 for v in &mut __struct.library_version_hash {
25006 let val = buf.get_u8();
25007 *v = val;
25008 }
25009 Ok(__struct)
25010 }
25011 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25012 let mut __tmp = BytesMut::new(bytes);
25013 #[allow(clippy::absurd_extreme_comparisons)]
25014 #[allow(unused_comparisons)]
25015 if __tmp.remaining() < Self::ENCODED_LEN {
25016 panic!(
25017 "buffer is too small (need {} bytes, but got {})",
25018 Self::ENCODED_LEN,
25019 __tmp.remaining(),
25020 )
25021 }
25022 __tmp.put_u16_le(self.version);
25023 __tmp.put_u16_le(self.min_version);
25024 __tmp.put_u16_le(self.max_version);
25025 for val in &self.spec_version_hash {
25026 __tmp.put_u8(*val);
25027 }
25028 for val in &self.library_version_hash {
25029 __tmp.put_u8(*val);
25030 }
25031 if matches!(version, MavlinkVersion::V2) {
25032 let len = __tmp.len();
25033 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25034 } else {
25035 __tmp.len()
25036 }
25037 }
25038}
25039#[doc = "Status generated by radio and injected into MAVLink stream."]
25040#[doc = ""]
25041#[doc = "ID: 109"]
25042#[derive(Debug, Clone, PartialEq)]
25043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25045#[cfg_attr(feature = "ts", derive(TS))]
25046#[cfg_attr(feature = "ts", ts(export))]
25047pub struct RADIO_STATUS_DATA {
25048 #[doc = "Count of radio packet receive errors (since boot)."]
25049 pub rxerrors: u16,
25050 #[doc = "Count of error corrected radio packets (since boot)."]
25051 pub fixed: u16,
25052 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25053 pub rssi: u8,
25054 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25055 pub remrssi: u8,
25056 #[doc = "Remaining free transmitter buffer space."]
25057 pub txbuf: u8,
25058 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25059 pub noise: u8,
25060 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25061 pub remnoise: u8,
25062}
25063impl RADIO_STATUS_DATA {
25064 pub const ENCODED_LEN: usize = 9usize;
25065 pub const DEFAULT: Self = Self {
25066 rxerrors: 0_u16,
25067 fixed: 0_u16,
25068 rssi: 0_u8,
25069 remrssi: 0_u8,
25070 txbuf: 0_u8,
25071 noise: 0_u8,
25072 remnoise: 0_u8,
25073 };
25074 #[cfg(feature = "arbitrary")]
25075 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25076 use arbitrary::{Arbitrary, Unstructured};
25077 let mut buf = [0u8; 1024];
25078 rng.fill_bytes(&mut buf);
25079 let mut unstructured = Unstructured::new(&buf);
25080 Self::arbitrary(&mut unstructured).unwrap_or_default()
25081 }
25082}
25083impl Default for RADIO_STATUS_DATA {
25084 fn default() -> Self {
25085 Self::DEFAULT.clone()
25086 }
25087}
25088impl MessageData for RADIO_STATUS_DATA {
25089 type Message = MavMessage;
25090 const ID: u32 = 109u32;
25091 const NAME: &'static str = "RADIO_STATUS";
25092 const EXTRA_CRC: u8 = 185u8;
25093 const ENCODED_LEN: usize = 9usize;
25094 fn deser(
25095 _version: MavlinkVersion,
25096 __input: &[u8],
25097 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25098 let avail_len = __input.len();
25099 let mut payload_buf = [0; Self::ENCODED_LEN];
25100 let mut buf = if avail_len < Self::ENCODED_LEN {
25101 payload_buf[0..avail_len].copy_from_slice(__input);
25102 Bytes::new(&payload_buf)
25103 } else {
25104 Bytes::new(__input)
25105 };
25106 let mut __struct = Self::default();
25107 __struct.rxerrors = buf.get_u16_le();
25108 __struct.fixed = buf.get_u16_le();
25109 __struct.rssi = buf.get_u8();
25110 __struct.remrssi = buf.get_u8();
25111 __struct.txbuf = buf.get_u8();
25112 __struct.noise = buf.get_u8();
25113 __struct.remnoise = buf.get_u8();
25114 Ok(__struct)
25115 }
25116 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25117 let mut __tmp = BytesMut::new(bytes);
25118 #[allow(clippy::absurd_extreme_comparisons)]
25119 #[allow(unused_comparisons)]
25120 if __tmp.remaining() < Self::ENCODED_LEN {
25121 panic!(
25122 "buffer is too small (need {} bytes, but got {})",
25123 Self::ENCODED_LEN,
25124 __tmp.remaining(),
25125 )
25126 }
25127 __tmp.put_u16_le(self.rxerrors);
25128 __tmp.put_u16_le(self.fixed);
25129 __tmp.put_u8(self.rssi);
25130 __tmp.put_u8(self.remrssi);
25131 __tmp.put_u8(self.txbuf);
25132 __tmp.put_u8(self.noise);
25133 __tmp.put_u8(self.remnoise);
25134 if matches!(version, MavlinkVersion::V2) {
25135 let len = __tmp.len();
25136 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25137 } else {
25138 __tmp.len()
25139 }
25140 }
25141}
25142#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25143#[doc = ""]
25144#[doc = "ID: 27"]
25145#[derive(Debug, Clone, PartialEq)]
25146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25147#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25148#[cfg_attr(feature = "ts", derive(TS))]
25149#[cfg_attr(feature = "ts", ts(export))]
25150pub struct RAW_IMU_DATA {
25151 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25152 pub time_usec: u64,
25153 #[doc = "X acceleration (raw)"]
25154 pub xacc: i16,
25155 #[doc = "Y acceleration (raw)"]
25156 pub yacc: i16,
25157 #[doc = "Z acceleration (raw)"]
25158 pub zacc: i16,
25159 #[doc = "Angular speed around X axis (raw)"]
25160 pub xgyro: i16,
25161 #[doc = "Angular speed around Y axis (raw)"]
25162 pub ygyro: i16,
25163 #[doc = "Angular speed around Z axis (raw)"]
25164 pub zgyro: i16,
25165 #[doc = "X Magnetic field (raw)"]
25166 pub xmag: i16,
25167 #[doc = "Y Magnetic field (raw)"]
25168 pub ymag: i16,
25169 #[doc = "Z Magnetic field (raw)"]
25170 pub zmag: i16,
25171 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25172 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25173 pub id: u8,
25174 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25175 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25176 pub temperature: i16,
25177}
25178impl RAW_IMU_DATA {
25179 pub const ENCODED_LEN: usize = 29usize;
25180 pub const DEFAULT: Self = Self {
25181 time_usec: 0_u64,
25182 xacc: 0_i16,
25183 yacc: 0_i16,
25184 zacc: 0_i16,
25185 xgyro: 0_i16,
25186 ygyro: 0_i16,
25187 zgyro: 0_i16,
25188 xmag: 0_i16,
25189 ymag: 0_i16,
25190 zmag: 0_i16,
25191 id: 0_u8,
25192 temperature: 0_i16,
25193 };
25194 #[cfg(feature = "arbitrary")]
25195 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25196 use arbitrary::{Arbitrary, Unstructured};
25197 let mut buf = [0u8; 1024];
25198 rng.fill_bytes(&mut buf);
25199 let mut unstructured = Unstructured::new(&buf);
25200 Self::arbitrary(&mut unstructured).unwrap_or_default()
25201 }
25202}
25203impl Default for RAW_IMU_DATA {
25204 fn default() -> Self {
25205 Self::DEFAULT.clone()
25206 }
25207}
25208impl MessageData for RAW_IMU_DATA {
25209 type Message = MavMessage;
25210 const ID: u32 = 27u32;
25211 const NAME: &'static str = "RAW_IMU";
25212 const EXTRA_CRC: u8 = 144u8;
25213 const ENCODED_LEN: usize = 29usize;
25214 fn deser(
25215 _version: MavlinkVersion,
25216 __input: &[u8],
25217 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25218 let avail_len = __input.len();
25219 let mut payload_buf = [0; Self::ENCODED_LEN];
25220 let mut buf = if avail_len < Self::ENCODED_LEN {
25221 payload_buf[0..avail_len].copy_from_slice(__input);
25222 Bytes::new(&payload_buf)
25223 } else {
25224 Bytes::new(__input)
25225 };
25226 let mut __struct = Self::default();
25227 __struct.time_usec = buf.get_u64_le();
25228 __struct.xacc = buf.get_i16_le();
25229 __struct.yacc = buf.get_i16_le();
25230 __struct.zacc = buf.get_i16_le();
25231 __struct.xgyro = buf.get_i16_le();
25232 __struct.ygyro = buf.get_i16_le();
25233 __struct.zgyro = buf.get_i16_le();
25234 __struct.xmag = buf.get_i16_le();
25235 __struct.ymag = buf.get_i16_le();
25236 __struct.zmag = buf.get_i16_le();
25237 __struct.id = buf.get_u8();
25238 __struct.temperature = buf.get_i16_le();
25239 Ok(__struct)
25240 }
25241 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25242 let mut __tmp = BytesMut::new(bytes);
25243 #[allow(clippy::absurd_extreme_comparisons)]
25244 #[allow(unused_comparisons)]
25245 if __tmp.remaining() < Self::ENCODED_LEN {
25246 panic!(
25247 "buffer is too small (need {} bytes, but got {})",
25248 Self::ENCODED_LEN,
25249 __tmp.remaining(),
25250 )
25251 }
25252 __tmp.put_u64_le(self.time_usec);
25253 __tmp.put_i16_le(self.xacc);
25254 __tmp.put_i16_le(self.yacc);
25255 __tmp.put_i16_le(self.zacc);
25256 __tmp.put_i16_le(self.xgyro);
25257 __tmp.put_i16_le(self.ygyro);
25258 __tmp.put_i16_le(self.zgyro);
25259 __tmp.put_i16_le(self.xmag);
25260 __tmp.put_i16_le(self.ymag);
25261 __tmp.put_i16_le(self.zmag);
25262 if matches!(version, MavlinkVersion::V2) {
25263 __tmp.put_u8(self.id);
25264 __tmp.put_i16_le(self.temperature);
25265 let len = __tmp.len();
25266 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25267 } else {
25268 __tmp.len()
25269 }
25270 }
25271}
25272#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25273#[doc = ""]
25274#[doc = "ID: 28"]
25275#[derive(Debug, Clone, PartialEq)]
25276#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25277#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25278#[cfg_attr(feature = "ts", derive(TS))]
25279#[cfg_attr(feature = "ts", ts(export))]
25280pub struct RAW_PRESSURE_DATA {
25281 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25282 pub time_usec: u64,
25283 #[doc = "Absolute pressure (raw)"]
25284 pub press_abs: i16,
25285 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25286 pub press_diff1: i16,
25287 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25288 pub press_diff2: i16,
25289 #[doc = "Raw Temperature measurement (raw)"]
25290 pub temperature: i16,
25291}
25292impl RAW_PRESSURE_DATA {
25293 pub const ENCODED_LEN: usize = 16usize;
25294 pub const DEFAULT: Self = Self {
25295 time_usec: 0_u64,
25296 press_abs: 0_i16,
25297 press_diff1: 0_i16,
25298 press_diff2: 0_i16,
25299 temperature: 0_i16,
25300 };
25301 #[cfg(feature = "arbitrary")]
25302 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25303 use arbitrary::{Arbitrary, Unstructured};
25304 let mut buf = [0u8; 1024];
25305 rng.fill_bytes(&mut buf);
25306 let mut unstructured = Unstructured::new(&buf);
25307 Self::arbitrary(&mut unstructured).unwrap_or_default()
25308 }
25309}
25310impl Default for RAW_PRESSURE_DATA {
25311 fn default() -> Self {
25312 Self::DEFAULT.clone()
25313 }
25314}
25315impl MessageData for RAW_PRESSURE_DATA {
25316 type Message = MavMessage;
25317 const ID: u32 = 28u32;
25318 const NAME: &'static str = "RAW_PRESSURE";
25319 const EXTRA_CRC: u8 = 67u8;
25320 const ENCODED_LEN: usize = 16usize;
25321 fn deser(
25322 _version: MavlinkVersion,
25323 __input: &[u8],
25324 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25325 let avail_len = __input.len();
25326 let mut payload_buf = [0; Self::ENCODED_LEN];
25327 let mut buf = if avail_len < Self::ENCODED_LEN {
25328 payload_buf[0..avail_len].copy_from_slice(__input);
25329 Bytes::new(&payload_buf)
25330 } else {
25331 Bytes::new(__input)
25332 };
25333 let mut __struct = Self::default();
25334 __struct.time_usec = buf.get_u64_le();
25335 __struct.press_abs = buf.get_i16_le();
25336 __struct.press_diff1 = buf.get_i16_le();
25337 __struct.press_diff2 = buf.get_i16_le();
25338 __struct.temperature = buf.get_i16_le();
25339 Ok(__struct)
25340 }
25341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25342 let mut __tmp = BytesMut::new(bytes);
25343 #[allow(clippy::absurd_extreme_comparisons)]
25344 #[allow(unused_comparisons)]
25345 if __tmp.remaining() < Self::ENCODED_LEN {
25346 panic!(
25347 "buffer is too small (need {} bytes, but got {})",
25348 Self::ENCODED_LEN,
25349 __tmp.remaining(),
25350 )
25351 }
25352 __tmp.put_u64_le(self.time_usec);
25353 __tmp.put_i16_le(self.press_abs);
25354 __tmp.put_i16_le(self.press_diff1);
25355 __tmp.put_i16_le(self.press_diff2);
25356 __tmp.put_i16_le(self.temperature);
25357 if matches!(version, MavlinkVersion::V2) {
25358 let len = __tmp.len();
25359 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25360 } else {
25361 __tmp.len()
25362 }
25363 }
25364}
25365#[doc = "RPM sensor data message."]
25366#[doc = ""]
25367#[doc = "ID: 339"]
25368#[derive(Debug, Clone, PartialEq)]
25369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25370#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25371#[cfg_attr(feature = "ts", derive(TS))]
25372#[cfg_attr(feature = "ts", ts(export))]
25373pub struct RAW_RPM_DATA {
25374 #[doc = "Indicated rate"]
25375 pub frequency: f32,
25376 #[doc = "Index of this RPM sensor (0-indexed)"]
25377 pub index: u8,
25378}
25379impl RAW_RPM_DATA {
25380 pub const ENCODED_LEN: usize = 5usize;
25381 pub const DEFAULT: Self = Self {
25382 frequency: 0.0_f32,
25383 index: 0_u8,
25384 };
25385 #[cfg(feature = "arbitrary")]
25386 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25387 use arbitrary::{Arbitrary, Unstructured};
25388 let mut buf = [0u8; 1024];
25389 rng.fill_bytes(&mut buf);
25390 let mut unstructured = Unstructured::new(&buf);
25391 Self::arbitrary(&mut unstructured).unwrap_or_default()
25392 }
25393}
25394impl Default for RAW_RPM_DATA {
25395 fn default() -> Self {
25396 Self::DEFAULT.clone()
25397 }
25398}
25399impl MessageData for RAW_RPM_DATA {
25400 type Message = MavMessage;
25401 const ID: u32 = 339u32;
25402 const NAME: &'static str = "RAW_RPM";
25403 const EXTRA_CRC: u8 = 199u8;
25404 const ENCODED_LEN: usize = 5usize;
25405 fn deser(
25406 _version: MavlinkVersion,
25407 __input: &[u8],
25408 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25409 let avail_len = __input.len();
25410 let mut payload_buf = [0; Self::ENCODED_LEN];
25411 let mut buf = if avail_len < Self::ENCODED_LEN {
25412 payload_buf[0..avail_len].copy_from_slice(__input);
25413 Bytes::new(&payload_buf)
25414 } else {
25415 Bytes::new(__input)
25416 };
25417 let mut __struct = Self::default();
25418 __struct.frequency = buf.get_f32_le();
25419 __struct.index = buf.get_u8();
25420 Ok(__struct)
25421 }
25422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25423 let mut __tmp = BytesMut::new(bytes);
25424 #[allow(clippy::absurd_extreme_comparisons)]
25425 #[allow(unused_comparisons)]
25426 if __tmp.remaining() < Self::ENCODED_LEN {
25427 panic!(
25428 "buffer is too small (need {} bytes, but got {})",
25429 Self::ENCODED_LEN,
25430 __tmp.remaining(),
25431 )
25432 }
25433 __tmp.put_f32_le(self.frequency);
25434 __tmp.put_u8(self.index);
25435 if matches!(version, MavlinkVersion::V2) {
25436 let len = __tmp.len();
25437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25438 } else {
25439 __tmp.len()
25440 }
25441 }
25442}
25443#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25444#[doc = ""]
25445#[doc = "ID: 65"]
25446#[derive(Debug, Clone, PartialEq)]
25447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25449#[cfg_attr(feature = "ts", derive(TS))]
25450#[cfg_attr(feature = "ts", ts(export))]
25451pub struct RC_CHANNELS_DATA {
25452 #[doc = "Timestamp (time since system boot)."]
25453 pub time_boot_ms: u32,
25454 #[doc = "RC channel 1 value."]
25455 pub chan1_raw: u16,
25456 #[doc = "RC channel 2 value."]
25457 pub chan2_raw: u16,
25458 #[doc = "RC channel 3 value."]
25459 pub chan3_raw: u16,
25460 #[doc = "RC channel 4 value."]
25461 pub chan4_raw: u16,
25462 #[doc = "RC channel 5 value."]
25463 pub chan5_raw: u16,
25464 #[doc = "RC channel 6 value."]
25465 pub chan6_raw: u16,
25466 #[doc = "RC channel 7 value."]
25467 pub chan7_raw: u16,
25468 #[doc = "RC channel 8 value."]
25469 pub chan8_raw: u16,
25470 #[doc = "RC channel 9 value."]
25471 pub chan9_raw: u16,
25472 #[doc = "RC channel 10 value."]
25473 pub chan10_raw: u16,
25474 #[doc = "RC channel 11 value."]
25475 pub chan11_raw: u16,
25476 #[doc = "RC channel 12 value."]
25477 pub chan12_raw: u16,
25478 #[doc = "RC channel 13 value."]
25479 pub chan13_raw: u16,
25480 #[doc = "RC channel 14 value."]
25481 pub chan14_raw: u16,
25482 #[doc = "RC channel 15 value."]
25483 pub chan15_raw: u16,
25484 #[doc = "RC channel 16 value."]
25485 pub chan16_raw: u16,
25486 #[doc = "RC channel 17 value."]
25487 pub chan17_raw: u16,
25488 #[doc = "RC channel 18 value."]
25489 pub chan18_raw: u16,
25490 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25491 pub chancount: u8,
25492 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25493 pub rssi: u8,
25494}
25495impl RC_CHANNELS_DATA {
25496 pub const ENCODED_LEN: usize = 42usize;
25497 pub const DEFAULT: Self = Self {
25498 time_boot_ms: 0_u32,
25499 chan1_raw: 0_u16,
25500 chan2_raw: 0_u16,
25501 chan3_raw: 0_u16,
25502 chan4_raw: 0_u16,
25503 chan5_raw: 0_u16,
25504 chan6_raw: 0_u16,
25505 chan7_raw: 0_u16,
25506 chan8_raw: 0_u16,
25507 chan9_raw: 0_u16,
25508 chan10_raw: 0_u16,
25509 chan11_raw: 0_u16,
25510 chan12_raw: 0_u16,
25511 chan13_raw: 0_u16,
25512 chan14_raw: 0_u16,
25513 chan15_raw: 0_u16,
25514 chan16_raw: 0_u16,
25515 chan17_raw: 0_u16,
25516 chan18_raw: 0_u16,
25517 chancount: 0_u8,
25518 rssi: 0_u8,
25519 };
25520 #[cfg(feature = "arbitrary")]
25521 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25522 use arbitrary::{Arbitrary, Unstructured};
25523 let mut buf = [0u8; 1024];
25524 rng.fill_bytes(&mut buf);
25525 let mut unstructured = Unstructured::new(&buf);
25526 Self::arbitrary(&mut unstructured).unwrap_or_default()
25527 }
25528}
25529impl Default for RC_CHANNELS_DATA {
25530 fn default() -> Self {
25531 Self::DEFAULT.clone()
25532 }
25533}
25534impl MessageData for RC_CHANNELS_DATA {
25535 type Message = MavMessage;
25536 const ID: u32 = 65u32;
25537 const NAME: &'static str = "RC_CHANNELS";
25538 const EXTRA_CRC: u8 = 118u8;
25539 const ENCODED_LEN: usize = 42usize;
25540 fn deser(
25541 _version: MavlinkVersion,
25542 __input: &[u8],
25543 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25544 let avail_len = __input.len();
25545 let mut payload_buf = [0; Self::ENCODED_LEN];
25546 let mut buf = if avail_len < Self::ENCODED_LEN {
25547 payload_buf[0..avail_len].copy_from_slice(__input);
25548 Bytes::new(&payload_buf)
25549 } else {
25550 Bytes::new(__input)
25551 };
25552 let mut __struct = Self::default();
25553 __struct.time_boot_ms = buf.get_u32_le();
25554 __struct.chan1_raw = buf.get_u16_le();
25555 __struct.chan2_raw = buf.get_u16_le();
25556 __struct.chan3_raw = buf.get_u16_le();
25557 __struct.chan4_raw = buf.get_u16_le();
25558 __struct.chan5_raw = buf.get_u16_le();
25559 __struct.chan6_raw = buf.get_u16_le();
25560 __struct.chan7_raw = buf.get_u16_le();
25561 __struct.chan8_raw = buf.get_u16_le();
25562 __struct.chan9_raw = buf.get_u16_le();
25563 __struct.chan10_raw = buf.get_u16_le();
25564 __struct.chan11_raw = buf.get_u16_le();
25565 __struct.chan12_raw = buf.get_u16_le();
25566 __struct.chan13_raw = buf.get_u16_le();
25567 __struct.chan14_raw = buf.get_u16_le();
25568 __struct.chan15_raw = buf.get_u16_le();
25569 __struct.chan16_raw = buf.get_u16_le();
25570 __struct.chan17_raw = buf.get_u16_le();
25571 __struct.chan18_raw = buf.get_u16_le();
25572 __struct.chancount = buf.get_u8();
25573 __struct.rssi = buf.get_u8();
25574 Ok(__struct)
25575 }
25576 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25577 let mut __tmp = BytesMut::new(bytes);
25578 #[allow(clippy::absurd_extreme_comparisons)]
25579 #[allow(unused_comparisons)]
25580 if __tmp.remaining() < Self::ENCODED_LEN {
25581 panic!(
25582 "buffer is too small (need {} bytes, but got {})",
25583 Self::ENCODED_LEN,
25584 __tmp.remaining(),
25585 )
25586 }
25587 __tmp.put_u32_le(self.time_boot_ms);
25588 __tmp.put_u16_le(self.chan1_raw);
25589 __tmp.put_u16_le(self.chan2_raw);
25590 __tmp.put_u16_le(self.chan3_raw);
25591 __tmp.put_u16_le(self.chan4_raw);
25592 __tmp.put_u16_le(self.chan5_raw);
25593 __tmp.put_u16_le(self.chan6_raw);
25594 __tmp.put_u16_le(self.chan7_raw);
25595 __tmp.put_u16_le(self.chan8_raw);
25596 __tmp.put_u16_le(self.chan9_raw);
25597 __tmp.put_u16_le(self.chan10_raw);
25598 __tmp.put_u16_le(self.chan11_raw);
25599 __tmp.put_u16_le(self.chan12_raw);
25600 __tmp.put_u16_le(self.chan13_raw);
25601 __tmp.put_u16_le(self.chan14_raw);
25602 __tmp.put_u16_le(self.chan15_raw);
25603 __tmp.put_u16_le(self.chan16_raw);
25604 __tmp.put_u16_le(self.chan17_raw);
25605 __tmp.put_u16_le(self.chan18_raw);
25606 __tmp.put_u8(self.chancount);
25607 __tmp.put_u8(self.rssi);
25608 if matches!(version, MavlinkVersion::V2) {
25609 let len = __tmp.len();
25610 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25611 } else {
25612 __tmp.len()
25613 }
25614 }
25615}
25616#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25617#[doc = ""]
25618#[doc = "ID: 70"]
25619#[derive(Debug, Clone, PartialEq)]
25620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25621#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25622#[cfg_attr(feature = "ts", derive(TS))]
25623#[cfg_attr(feature = "ts", ts(export))]
25624pub struct RC_CHANNELS_OVERRIDE_DATA {
25625 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25626 pub chan1_raw: u16,
25627 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25628 pub chan2_raw: u16,
25629 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25630 pub chan3_raw: u16,
25631 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25632 pub chan4_raw: u16,
25633 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25634 pub chan5_raw: u16,
25635 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25636 pub chan6_raw: u16,
25637 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25638 pub chan7_raw: u16,
25639 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25640 pub chan8_raw: u16,
25641 #[doc = "System ID"]
25642 pub target_system: u8,
25643 #[doc = "Component ID"]
25644 pub target_component: u8,
25645 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25646 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25647 pub chan9_raw: u16,
25648 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25649 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25650 pub chan10_raw: u16,
25651 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25652 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25653 pub chan11_raw: u16,
25654 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25655 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25656 pub chan12_raw: u16,
25657 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25658 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25659 pub chan13_raw: u16,
25660 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25661 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25662 pub chan14_raw: u16,
25663 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25664 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25665 pub chan15_raw: u16,
25666 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25667 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25668 pub chan16_raw: u16,
25669 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25670 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25671 pub chan17_raw: u16,
25672 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25673 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25674 pub chan18_raw: u16,
25675}
25676impl RC_CHANNELS_OVERRIDE_DATA {
25677 pub const ENCODED_LEN: usize = 38usize;
25678 pub const DEFAULT: Self = Self {
25679 chan1_raw: 0_u16,
25680 chan2_raw: 0_u16,
25681 chan3_raw: 0_u16,
25682 chan4_raw: 0_u16,
25683 chan5_raw: 0_u16,
25684 chan6_raw: 0_u16,
25685 chan7_raw: 0_u16,
25686 chan8_raw: 0_u16,
25687 target_system: 0_u8,
25688 target_component: 0_u8,
25689 chan9_raw: 0_u16,
25690 chan10_raw: 0_u16,
25691 chan11_raw: 0_u16,
25692 chan12_raw: 0_u16,
25693 chan13_raw: 0_u16,
25694 chan14_raw: 0_u16,
25695 chan15_raw: 0_u16,
25696 chan16_raw: 0_u16,
25697 chan17_raw: 0_u16,
25698 chan18_raw: 0_u16,
25699 };
25700 #[cfg(feature = "arbitrary")]
25701 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25702 use arbitrary::{Arbitrary, Unstructured};
25703 let mut buf = [0u8; 1024];
25704 rng.fill_bytes(&mut buf);
25705 let mut unstructured = Unstructured::new(&buf);
25706 Self::arbitrary(&mut unstructured).unwrap_or_default()
25707 }
25708}
25709impl Default for RC_CHANNELS_OVERRIDE_DATA {
25710 fn default() -> Self {
25711 Self::DEFAULT.clone()
25712 }
25713}
25714impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25715 type Message = MavMessage;
25716 const ID: u32 = 70u32;
25717 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25718 const EXTRA_CRC: u8 = 124u8;
25719 const ENCODED_LEN: usize = 38usize;
25720 fn deser(
25721 _version: MavlinkVersion,
25722 __input: &[u8],
25723 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25724 let avail_len = __input.len();
25725 let mut payload_buf = [0; Self::ENCODED_LEN];
25726 let mut buf = if avail_len < Self::ENCODED_LEN {
25727 payload_buf[0..avail_len].copy_from_slice(__input);
25728 Bytes::new(&payload_buf)
25729 } else {
25730 Bytes::new(__input)
25731 };
25732 let mut __struct = Self::default();
25733 __struct.chan1_raw = buf.get_u16_le();
25734 __struct.chan2_raw = buf.get_u16_le();
25735 __struct.chan3_raw = buf.get_u16_le();
25736 __struct.chan4_raw = buf.get_u16_le();
25737 __struct.chan5_raw = buf.get_u16_le();
25738 __struct.chan6_raw = buf.get_u16_le();
25739 __struct.chan7_raw = buf.get_u16_le();
25740 __struct.chan8_raw = buf.get_u16_le();
25741 __struct.target_system = buf.get_u8();
25742 __struct.target_component = buf.get_u8();
25743 __struct.chan9_raw = buf.get_u16_le();
25744 __struct.chan10_raw = buf.get_u16_le();
25745 __struct.chan11_raw = buf.get_u16_le();
25746 __struct.chan12_raw = buf.get_u16_le();
25747 __struct.chan13_raw = buf.get_u16_le();
25748 __struct.chan14_raw = buf.get_u16_le();
25749 __struct.chan15_raw = buf.get_u16_le();
25750 __struct.chan16_raw = buf.get_u16_le();
25751 __struct.chan17_raw = buf.get_u16_le();
25752 __struct.chan18_raw = buf.get_u16_le();
25753 Ok(__struct)
25754 }
25755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25756 let mut __tmp = BytesMut::new(bytes);
25757 #[allow(clippy::absurd_extreme_comparisons)]
25758 #[allow(unused_comparisons)]
25759 if __tmp.remaining() < Self::ENCODED_LEN {
25760 panic!(
25761 "buffer is too small (need {} bytes, but got {})",
25762 Self::ENCODED_LEN,
25763 __tmp.remaining(),
25764 )
25765 }
25766 __tmp.put_u16_le(self.chan1_raw);
25767 __tmp.put_u16_le(self.chan2_raw);
25768 __tmp.put_u16_le(self.chan3_raw);
25769 __tmp.put_u16_le(self.chan4_raw);
25770 __tmp.put_u16_le(self.chan5_raw);
25771 __tmp.put_u16_le(self.chan6_raw);
25772 __tmp.put_u16_le(self.chan7_raw);
25773 __tmp.put_u16_le(self.chan8_raw);
25774 __tmp.put_u8(self.target_system);
25775 __tmp.put_u8(self.target_component);
25776 if matches!(version, MavlinkVersion::V2) {
25777 __tmp.put_u16_le(self.chan9_raw);
25778 __tmp.put_u16_le(self.chan10_raw);
25779 __tmp.put_u16_le(self.chan11_raw);
25780 __tmp.put_u16_le(self.chan12_raw);
25781 __tmp.put_u16_le(self.chan13_raw);
25782 __tmp.put_u16_le(self.chan14_raw);
25783 __tmp.put_u16_le(self.chan15_raw);
25784 __tmp.put_u16_le(self.chan16_raw);
25785 __tmp.put_u16_le(self.chan17_raw);
25786 __tmp.put_u16_le(self.chan18_raw);
25787 let len = __tmp.len();
25788 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25789 } else {
25790 __tmp.len()
25791 }
25792 }
25793}
25794#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25795#[doc = ""]
25796#[doc = "ID: 35"]
25797#[derive(Debug, Clone, PartialEq)]
25798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25800#[cfg_attr(feature = "ts", derive(TS))]
25801#[cfg_attr(feature = "ts", ts(export))]
25802pub struct RC_CHANNELS_RAW_DATA {
25803 #[doc = "Timestamp (time since system boot)."]
25804 pub time_boot_ms: u32,
25805 #[doc = "RC channel 1 value."]
25806 pub chan1_raw: u16,
25807 #[doc = "RC channel 2 value."]
25808 pub chan2_raw: u16,
25809 #[doc = "RC channel 3 value."]
25810 pub chan3_raw: u16,
25811 #[doc = "RC channel 4 value."]
25812 pub chan4_raw: u16,
25813 #[doc = "RC channel 5 value."]
25814 pub chan5_raw: u16,
25815 #[doc = "RC channel 6 value."]
25816 pub chan6_raw: u16,
25817 #[doc = "RC channel 7 value."]
25818 pub chan7_raw: u16,
25819 #[doc = "RC channel 8 value."]
25820 pub chan8_raw: u16,
25821 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25822 pub port: u8,
25823 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25824 pub rssi: u8,
25825}
25826impl RC_CHANNELS_RAW_DATA {
25827 pub const ENCODED_LEN: usize = 22usize;
25828 pub const DEFAULT: Self = Self {
25829 time_boot_ms: 0_u32,
25830 chan1_raw: 0_u16,
25831 chan2_raw: 0_u16,
25832 chan3_raw: 0_u16,
25833 chan4_raw: 0_u16,
25834 chan5_raw: 0_u16,
25835 chan6_raw: 0_u16,
25836 chan7_raw: 0_u16,
25837 chan8_raw: 0_u16,
25838 port: 0_u8,
25839 rssi: 0_u8,
25840 };
25841 #[cfg(feature = "arbitrary")]
25842 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25843 use arbitrary::{Arbitrary, Unstructured};
25844 let mut buf = [0u8; 1024];
25845 rng.fill_bytes(&mut buf);
25846 let mut unstructured = Unstructured::new(&buf);
25847 Self::arbitrary(&mut unstructured).unwrap_or_default()
25848 }
25849}
25850impl Default for RC_CHANNELS_RAW_DATA {
25851 fn default() -> Self {
25852 Self::DEFAULT.clone()
25853 }
25854}
25855impl MessageData for RC_CHANNELS_RAW_DATA {
25856 type Message = MavMessage;
25857 const ID: u32 = 35u32;
25858 const NAME: &'static str = "RC_CHANNELS_RAW";
25859 const EXTRA_CRC: u8 = 244u8;
25860 const ENCODED_LEN: usize = 22usize;
25861 fn deser(
25862 _version: MavlinkVersion,
25863 __input: &[u8],
25864 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25865 let avail_len = __input.len();
25866 let mut payload_buf = [0; Self::ENCODED_LEN];
25867 let mut buf = if avail_len < Self::ENCODED_LEN {
25868 payload_buf[0..avail_len].copy_from_slice(__input);
25869 Bytes::new(&payload_buf)
25870 } else {
25871 Bytes::new(__input)
25872 };
25873 let mut __struct = Self::default();
25874 __struct.time_boot_ms = buf.get_u32_le();
25875 __struct.chan1_raw = buf.get_u16_le();
25876 __struct.chan2_raw = buf.get_u16_le();
25877 __struct.chan3_raw = buf.get_u16_le();
25878 __struct.chan4_raw = buf.get_u16_le();
25879 __struct.chan5_raw = buf.get_u16_le();
25880 __struct.chan6_raw = buf.get_u16_le();
25881 __struct.chan7_raw = buf.get_u16_le();
25882 __struct.chan8_raw = buf.get_u16_le();
25883 __struct.port = buf.get_u8();
25884 __struct.rssi = buf.get_u8();
25885 Ok(__struct)
25886 }
25887 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25888 let mut __tmp = BytesMut::new(bytes);
25889 #[allow(clippy::absurd_extreme_comparisons)]
25890 #[allow(unused_comparisons)]
25891 if __tmp.remaining() < Self::ENCODED_LEN {
25892 panic!(
25893 "buffer is too small (need {} bytes, but got {})",
25894 Self::ENCODED_LEN,
25895 __tmp.remaining(),
25896 )
25897 }
25898 __tmp.put_u32_le(self.time_boot_ms);
25899 __tmp.put_u16_le(self.chan1_raw);
25900 __tmp.put_u16_le(self.chan2_raw);
25901 __tmp.put_u16_le(self.chan3_raw);
25902 __tmp.put_u16_le(self.chan4_raw);
25903 __tmp.put_u16_le(self.chan5_raw);
25904 __tmp.put_u16_le(self.chan6_raw);
25905 __tmp.put_u16_le(self.chan7_raw);
25906 __tmp.put_u16_le(self.chan8_raw);
25907 __tmp.put_u8(self.port);
25908 __tmp.put_u8(self.rssi);
25909 if matches!(version, MavlinkVersion::V2) {
25910 let len = __tmp.len();
25911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25912 } else {
25913 __tmp.len()
25914 }
25915 }
25916}
25917#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25918#[doc = ""]
25919#[doc = "ID: 34"]
25920#[derive(Debug, Clone, PartialEq)]
25921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25923#[cfg_attr(feature = "ts", derive(TS))]
25924#[cfg_attr(feature = "ts", ts(export))]
25925pub struct RC_CHANNELS_SCALED_DATA {
25926 #[doc = "Timestamp (time since system boot)."]
25927 pub time_boot_ms: u32,
25928 #[doc = "RC channel 1 value scaled."]
25929 pub chan1_scaled: i16,
25930 #[doc = "RC channel 2 value scaled."]
25931 pub chan2_scaled: i16,
25932 #[doc = "RC channel 3 value scaled."]
25933 pub chan3_scaled: i16,
25934 #[doc = "RC channel 4 value scaled."]
25935 pub chan4_scaled: i16,
25936 #[doc = "RC channel 5 value scaled."]
25937 pub chan5_scaled: i16,
25938 #[doc = "RC channel 6 value scaled."]
25939 pub chan6_scaled: i16,
25940 #[doc = "RC channel 7 value scaled."]
25941 pub chan7_scaled: i16,
25942 #[doc = "RC channel 8 value scaled."]
25943 pub chan8_scaled: i16,
25944 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25945 pub port: u8,
25946 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25947 pub rssi: u8,
25948}
25949impl RC_CHANNELS_SCALED_DATA {
25950 pub const ENCODED_LEN: usize = 22usize;
25951 pub const DEFAULT: Self = Self {
25952 time_boot_ms: 0_u32,
25953 chan1_scaled: 0_i16,
25954 chan2_scaled: 0_i16,
25955 chan3_scaled: 0_i16,
25956 chan4_scaled: 0_i16,
25957 chan5_scaled: 0_i16,
25958 chan6_scaled: 0_i16,
25959 chan7_scaled: 0_i16,
25960 chan8_scaled: 0_i16,
25961 port: 0_u8,
25962 rssi: 0_u8,
25963 };
25964 #[cfg(feature = "arbitrary")]
25965 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25966 use arbitrary::{Arbitrary, Unstructured};
25967 let mut buf = [0u8; 1024];
25968 rng.fill_bytes(&mut buf);
25969 let mut unstructured = Unstructured::new(&buf);
25970 Self::arbitrary(&mut unstructured).unwrap_or_default()
25971 }
25972}
25973impl Default for RC_CHANNELS_SCALED_DATA {
25974 fn default() -> Self {
25975 Self::DEFAULT.clone()
25976 }
25977}
25978impl MessageData for RC_CHANNELS_SCALED_DATA {
25979 type Message = MavMessage;
25980 const ID: u32 = 34u32;
25981 const NAME: &'static str = "RC_CHANNELS_SCALED";
25982 const EXTRA_CRC: u8 = 237u8;
25983 const ENCODED_LEN: usize = 22usize;
25984 fn deser(
25985 _version: MavlinkVersion,
25986 __input: &[u8],
25987 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25988 let avail_len = __input.len();
25989 let mut payload_buf = [0; Self::ENCODED_LEN];
25990 let mut buf = if avail_len < Self::ENCODED_LEN {
25991 payload_buf[0..avail_len].copy_from_slice(__input);
25992 Bytes::new(&payload_buf)
25993 } else {
25994 Bytes::new(__input)
25995 };
25996 let mut __struct = Self::default();
25997 __struct.time_boot_ms = buf.get_u32_le();
25998 __struct.chan1_scaled = buf.get_i16_le();
25999 __struct.chan2_scaled = buf.get_i16_le();
26000 __struct.chan3_scaled = buf.get_i16_le();
26001 __struct.chan4_scaled = buf.get_i16_le();
26002 __struct.chan5_scaled = buf.get_i16_le();
26003 __struct.chan6_scaled = buf.get_i16_le();
26004 __struct.chan7_scaled = buf.get_i16_le();
26005 __struct.chan8_scaled = buf.get_i16_le();
26006 __struct.port = buf.get_u8();
26007 __struct.rssi = buf.get_u8();
26008 Ok(__struct)
26009 }
26010 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26011 let mut __tmp = BytesMut::new(bytes);
26012 #[allow(clippy::absurd_extreme_comparisons)]
26013 #[allow(unused_comparisons)]
26014 if __tmp.remaining() < Self::ENCODED_LEN {
26015 panic!(
26016 "buffer is too small (need {} bytes, but got {})",
26017 Self::ENCODED_LEN,
26018 __tmp.remaining(),
26019 )
26020 }
26021 __tmp.put_u32_le(self.time_boot_ms);
26022 __tmp.put_i16_le(self.chan1_scaled);
26023 __tmp.put_i16_le(self.chan2_scaled);
26024 __tmp.put_i16_le(self.chan3_scaled);
26025 __tmp.put_i16_le(self.chan4_scaled);
26026 __tmp.put_i16_le(self.chan5_scaled);
26027 __tmp.put_i16_le(self.chan6_scaled);
26028 __tmp.put_i16_le(self.chan7_scaled);
26029 __tmp.put_i16_le(self.chan8_scaled);
26030 __tmp.put_u8(self.port);
26031 __tmp.put_u8(self.rssi);
26032 if matches!(version, MavlinkVersion::V2) {
26033 let len = __tmp.len();
26034 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26035 } else {
26036 __tmp.len()
26037 }
26038 }
26039}
26040#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26041#[doc = "Request a data stream."]
26042#[doc = ""]
26043#[doc = "ID: 66"]
26044#[derive(Debug, Clone, PartialEq)]
26045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26047#[cfg_attr(feature = "ts", derive(TS))]
26048#[cfg_attr(feature = "ts", ts(export))]
26049pub struct REQUEST_DATA_STREAM_DATA {
26050 #[doc = "The requested message rate"]
26051 pub req_message_rate: u16,
26052 #[doc = "The target requested to send the message stream."]
26053 pub target_system: u8,
26054 #[doc = "The target requested to send the message stream."]
26055 pub target_component: u8,
26056 #[doc = "The ID of the requested data stream"]
26057 pub req_stream_id: u8,
26058 #[doc = "1 to start sending, 0 to stop sending."]
26059 pub start_stop: u8,
26060}
26061impl REQUEST_DATA_STREAM_DATA {
26062 pub const ENCODED_LEN: usize = 6usize;
26063 pub const DEFAULT: Self = Self {
26064 req_message_rate: 0_u16,
26065 target_system: 0_u8,
26066 target_component: 0_u8,
26067 req_stream_id: 0_u8,
26068 start_stop: 0_u8,
26069 };
26070 #[cfg(feature = "arbitrary")]
26071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26072 use arbitrary::{Arbitrary, Unstructured};
26073 let mut buf = [0u8; 1024];
26074 rng.fill_bytes(&mut buf);
26075 let mut unstructured = Unstructured::new(&buf);
26076 Self::arbitrary(&mut unstructured).unwrap_or_default()
26077 }
26078}
26079impl Default for REQUEST_DATA_STREAM_DATA {
26080 fn default() -> Self {
26081 Self::DEFAULT.clone()
26082 }
26083}
26084impl MessageData for REQUEST_DATA_STREAM_DATA {
26085 type Message = MavMessage;
26086 const ID: u32 = 66u32;
26087 const NAME: &'static str = "REQUEST_DATA_STREAM";
26088 const EXTRA_CRC: u8 = 148u8;
26089 const ENCODED_LEN: usize = 6usize;
26090 fn deser(
26091 _version: MavlinkVersion,
26092 __input: &[u8],
26093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26094 let avail_len = __input.len();
26095 let mut payload_buf = [0; Self::ENCODED_LEN];
26096 let mut buf = if avail_len < Self::ENCODED_LEN {
26097 payload_buf[0..avail_len].copy_from_slice(__input);
26098 Bytes::new(&payload_buf)
26099 } else {
26100 Bytes::new(__input)
26101 };
26102 let mut __struct = Self::default();
26103 __struct.req_message_rate = buf.get_u16_le();
26104 __struct.target_system = buf.get_u8();
26105 __struct.target_component = buf.get_u8();
26106 __struct.req_stream_id = buf.get_u8();
26107 __struct.start_stop = buf.get_u8();
26108 Ok(__struct)
26109 }
26110 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26111 let mut __tmp = BytesMut::new(bytes);
26112 #[allow(clippy::absurd_extreme_comparisons)]
26113 #[allow(unused_comparisons)]
26114 if __tmp.remaining() < Self::ENCODED_LEN {
26115 panic!(
26116 "buffer is too small (need {} bytes, but got {})",
26117 Self::ENCODED_LEN,
26118 __tmp.remaining(),
26119 )
26120 }
26121 __tmp.put_u16_le(self.req_message_rate);
26122 __tmp.put_u8(self.target_system);
26123 __tmp.put_u8(self.target_component);
26124 __tmp.put_u8(self.req_stream_id);
26125 __tmp.put_u8(self.start_stop);
26126 if matches!(version, MavlinkVersion::V2) {
26127 let len = __tmp.len();
26128 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26129 } else {
26130 __tmp.len()
26131 }
26132 }
26133}
26134#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26135#[doc = ""]
26136#[doc = "ID: 412"]
26137#[derive(Debug, Clone, PartialEq)]
26138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26139#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26140#[cfg_attr(feature = "ts", derive(TS))]
26141#[cfg_attr(feature = "ts", ts(export))]
26142pub struct REQUEST_EVENT_DATA {
26143 #[doc = "First sequence number of the requested event."]
26144 pub first_sequence: u16,
26145 #[doc = "Last sequence number of the requested event."]
26146 pub last_sequence: u16,
26147 #[doc = "System ID"]
26148 pub target_system: u8,
26149 #[doc = "Component ID"]
26150 pub target_component: u8,
26151}
26152impl REQUEST_EVENT_DATA {
26153 pub const ENCODED_LEN: usize = 6usize;
26154 pub const DEFAULT: Self = Self {
26155 first_sequence: 0_u16,
26156 last_sequence: 0_u16,
26157 target_system: 0_u8,
26158 target_component: 0_u8,
26159 };
26160 #[cfg(feature = "arbitrary")]
26161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26162 use arbitrary::{Arbitrary, Unstructured};
26163 let mut buf = [0u8; 1024];
26164 rng.fill_bytes(&mut buf);
26165 let mut unstructured = Unstructured::new(&buf);
26166 Self::arbitrary(&mut unstructured).unwrap_or_default()
26167 }
26168}
26169impl Default for REQUEST_EVENT_DATA {
26170 fn default() -> Self {
26171 Self::DEFAULT.clone()
26172 }
26173}
26174impl MessageData for REQUEST_EVENT_DATA {
26175 type Message = MavMessage;
26176 const ID: u32 = 412u32;
26177 const NAME: &'static str = "REQUEST_EVENT";
26178 const EXTRA_CRC: u8 = 33u8;
26179 const ENCODED_LEN: usize = 6usize;
26180 fn deser(
26181 _version: MavlinkVersion,
26182 __input: &[u8],
26183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26184 let avail_len = __input.len();
26185 let mut payload_buf = [0; Self::ENCODED_LEN];
26186 let mut buf = if avail_len < Self::ENCODED_LEN {
26187 payload_buf[0..avail_len].copy_from_slice(__input);
26188 Bytes::new(&payload_buf)
26189 } else {
26190 Bytes::new(__input)
26191 };
26192 let mut __struct = Self::default();
26193 __struct.first_sequence = buf.get_u16_le();
26194 __struct.last_sequence = buf.get_u16_le();
26195 __struct.target_system = buf.get_u8();
26196 __struct.target_component = buf.get_u8();
26197 Ok(__struct)
26198 }
26199 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26200 let mut __tmp = BytesMut::new(bytes);
26201 #[allow(clippy::absurd_extreme_comparisons)]
26202 #[allow(unused_comparisons)]
26203 if __tmp.remaining() < Self::ENCODED_LEN {
26204 panic!(
26205 "buffer is too small (need {} bytes, but got {})",
26206 Self::ENCODED_LEN,
26207 __tmp.remaining(),
26208 )
26209 }
26210 __tmp.put_u16_le(self.first_sequence);
26211 __tmp.put_u16_le(self.last_sequence);
26212 __tmp.put_u8(self.target_system);
26213 __tmp.put_u8(self.target_component);
26214 if matches!(version, MavlinkVersion::V2) {
26215 let len = __tmp.len();
26216 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26217 } else {
26218 __tmp.len()
26219 }
26220 }
26221}
26222#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26223#[doc = ""]
26224#[doc = "ID: 142"]
26225#[derive(Debug, Clone, PartialEq)]
26226#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26227#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26228#[cfg_attr(feature = "ts", derive(TS))]
26229#[cfg_attr(feature = "ts", ts(export))]
26230pub struct RESOURCE_REQUEST_DATA {
26231 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26232 pub request_id: u8,
26233 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26234 pub uri_type: u8,
26235 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26236 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26237 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26238 pub uri: [u8; 120],
26239 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26240 pub transfer_type: u8,
26241 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26242 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26243 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26244 pub storage: [u8; 120],
26245}
26246impl RESOURCE_REQUEST_DATA {
26247 pub const ENCODED_LEN: usize = 243usize;
26248 pub const DEFAULT: Self = Self {
26249 request_id: 0_u8,
26250 uri_type: 0_u8,
26251 uri: [0_u8; 120usize],
26252 transfer_type: 0_u8,
26253 storage: [0_u8; 120usize],
26254 };
26255 #[cfg(feature = "arbitrary")]
26256 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26257 use arbitrary::{Arbitrary, Unstructured};
26258 let mut buf = [0u8; 1024];
26259 rng.fill_bytes(&mut buf);
26260 let mut unstructured = Unstructured::new(&buf);
26261 Self::arbitrary(&mut unstructured).unwrap_or_default()
26262 }
26263}
26264impl Default for RESOURCE_REQUEST_DATA {
26265 fn default() -> Self {
26266 Self::DEFAULT.clone()
26267 }
26268}
26269impl MessageData for RESOURCE_REQUEST_DATA {
26270 type Message = MavMessage;
26271 const ID: u32 = 142u32;
26272 const NAME: &'static str = "RESOURCE_REQUEST";
26273 const EXTRA_CRC: u8 = 72u8;
26274 const ENCODED_LEN: usize = 243usize;
26275 fn deser(
26276 _version: MavlinkVersion,
26277 __input: &[u8],
26278 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26279 let avail_len = __input.len();
26280 let mut payload_buf = [0; Self::ENCODED_LEN];
26281 let mut buf = if avail_len < Self::ENCODED_LEN {
26282 payload_buf[0..avail_len].copy_from_slice(__input);
26283 Bytes::new(&payload_buf)
26284 } else {
26285 Bytes::new(__input)
26286 };
26287 let mut __struct = Self::default();
26288 __struct.request_id = buf.get_u8();
26289 __struct.uri_type = buf.get_u8();
26290 for v in &mut __struct.uri {
26291 let val = buf.get_u8();
26292 *v = val;
26293 }
26294 __struct.transfer_type = buf.get_u8();
26295 for v in &mut __struct.storage {
26296 let val = buf.get_u8();
26297 *v = val;
26298 }
26299 Ok(__struct)
26300 }
26301 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26302 let mut __tmp = BytesMut::new(bytes);
26303 #[allow(clippy::absurd_extreme_comparisons)]
26304 #[allow(unused_comparisons)]
26305 if __tmp.remaining() < Self::ENCODED_LEN {
26306 panic!(
26307 "buffer is too small (need {} bytes, but got {})",
26308 Self::ENCODED_LEN,
26309 __tmp.remaining(),
26310 )
26311 }
26312 __tmp.put_u8(self.request_id);
26313 __tmp.put_u8(self.uri_type);
26314 for val in &self.uri {
26315 __tmp.put_u8(*val);
26316 }
26317 __tmp.put_u8(self.transfer_type);
26318 for val in &self.storage {
26319 __tmp.put_u8(*val);
26320 }
26321 if matches!(version, MavlinkVersion::V2) {
26322 let len = __tmp.len();
26323 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26324 } else {
26325 __tmp.len()
26326 }
26327 }
26328}
26329#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26330#[doc = ""]
26331#[doc = "ID: 413"]
26332#[derive(Debug, Clone, PartialEq)]
26333#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26334#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26335#[cfg_attr(feature = "ts", derive(TS))]
26336#[cfg_attr(feature = "ts", ts(export))]
26337pub struct RESPONSE_EVENT_ERROR_DATA {
26338 #[doc = "Sequence number."]
26339 pub sequence: u16,
26340 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26341 pub sequence_oldest_available: u16,
26342 #[doc = "System ID"]
26343 pub target_system: u8,
26344 #[doc = "Component ID"]
26345 pub target_component: u8,
26346 #[doc = "Error reason."]
26347 pub reason: MavEventErrorReason,
26348}
26349impl RESPONSE_EVENT_ERROR_DATA {
26350 pub const ENCODED_LEN: usize = 7usize;
26351 pub const DEFAULT: Self = Self {
26352 sequence: 0_u16,
26353 sequence_oldest_available: 0_u16,
26354 target_system: 0_u8,
26355 target_component: 0_u8,
26356 reason: MavEventErrorReason::DEFAULT,
26357 };
26358 #[cfg(feature = "arbitrary")]
26359 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26360 use arbitrary::{Arbitrary, Unstructured};
26361 let mut buf = [0u8; 1024];
26362 rng.fill_bytes(&mut buf);
26363 let mut unstructured = Unstructured::new(&buf);
26364 Self::arbitrary(&mut unstructured).unwrap_or_default()
26365 }
26366}
26367impl Default for RESPONSE_EVENT_ERROR_DATA {
26368 fn default() -> Self {
26369 Self::DEFAULT.clone()
26370 }
26371}
26372impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26373 type Message = MavMessage;
26374 const ID: u32 = 413u32;
26375 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26376 const EXTRA_CRC: u8 = 77u8;
26377 const ENCODED_LEN: usize = 7usize;
26378 fn deser(
26379 _version: MavlinkVersion,
26380 __input: &[u8],
26381 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26382 let avail_len = __input.len();
26383 let mut payload_buf = [0; Self::ENCODED_LEN];
26384 let mut buf = if avail_len < Self::ENCODED_LEN {
26385 payload_buf[0..avail_len].copy_from_slice(__input);
26386 Bytes::new(&payload_buf)
26387 } else {
26388 Bytes::new(__input)
26389 };
26390 let mut __struct = Self::default();
26391 __struct.sequence = buf.get_u16_le();
26392 __struct.sequence_oldest_available = buf.get_u16_le();
26393 __struct.target_system = buf.get_u8();
26394 __struct.target_component = buf.get_u8();
26395 let tmp = buf.get_u8();
26396 __struct.reason =
26397 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26398 enum_type: "MavEventErrorReason",
26399 value: tmp as u32,
26400 })?;
26401 Ok(__struct)
26402 }
26403 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26404 let mut __tmp = BytesMut::new(bytes);
26405 #[allow(clippy::absurd_extreme_comparisons)]
26406 #[allow(unused_comparisons)]
26407 if __tmp.remaining() < Self::ENCODED_LEN {
26408 panic!(
26409 "buffer is too small (need {} bytes, but got {})",
26410 Self::ENCODED_LEN,
26411 __tmp.remaining(),
26412 )
26413 }
26414 __tmp.put_u16_le(self.sequence);
26415 __tmp.put_u16_le(self.sequence_oldest_available);
26416 __tmp.put_u8(self.target_system);
26417 __tmp.put_u8(self.target_component);
26418 __tmp.put_u8(self.reason as u8);
26419 if matches!(version, MavlinkVersion::V2) {
26420 let len = __tmp.len();
26421 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26422 } else {
26423 __tmp.len()
26424 }
26425 }
26426}
26427#[doc = "Read out the safety zone the MAV currently assumes."]
26428#[doc = ""]
26429#[doc = "ID: 55"]
26430#[derive(Debug, Clone, PartialEq)]
26431#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26433#[cfg_attr(feature = "ts", derive(TS))]
26434#[cfg_attr(feature = "ts", ts(export))]
26435pub struct SAFETY_ALLOWED_AREA_DATA {
26436 #[doc = "x position 1 / Latitude 1"]
26437 pub p1x: f32,
26438 #[doc = "y position 1 / Longitude 1"]
26439 pub p1y: f32,
26440 #[doc = "z position 1 / Altitude 1"]
26441 pub p1z: f32,
26442 #[doc = "x position 2 / Latitude 2"]
26443 pub p2x: f32,
26444 #[doc = "y position 2 / Longitude 2"]
26445 pub p2y: f32,
26446 #[doc = "z position 2 / Altitude 2"]
26447 pub p2z: f32,
26448 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26449 pub frame: MavFrame,
26450}
26451impl SAFETY_ALLOWED_AREA_DATA {
26452 pub const ENCODED_LEN: usize = 25usize;
26453 pub const DEFAULT: Self = Self {
26454 p1x: 0.0_f32,
26455 p1y: 0.0_f32,
26456 p1z: 0.0_f32,
26457 p2x: 0.0_f32,
26458 p2y: 0.0_f32,
26459 p2z: 0.0_f32,
26460 frame: MavFrame::DEFAULT,
26461 };
26462 #[cfg(feature = "arbitrary")]
26463 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26464 use arbitrary::{Arbitrary, Unstructured};
26465 let mut buf = [0u8; 1024];
26466 rng.fill_bytes(&mut buf);
26467 let mut unstructured = Unstructured::new(&buf);
26468 Self::arbitrary(&mut unstructured).unwrap_or_default()
26469 }
26470}
26471impl Default for SAFETY_ALLOWED_AREA_DATA {
26472 fn default() -> Self {
26473 Self::DEFAULT.clone()
26474 }
26475}
26476impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26477 type Message = MavMessage;
26478 const ID: u32 = 55u32;
26479 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26480 const EXTRA_CRC: u8 = 3u8;
26481 const ENCODED_LEN: usize = 25usize;
26482 fn deser(
26483 _version: MavlinkVersion,
26484 __input: &[u8],
26485 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26486 let avail_len = __input.len();
26487 let mut payload_buf = [0; Self::ENCODED_LEN];
26488 let mut buf = if avail_len < Self::ENCODED_LEN {
26489 payload_buf[0..avail_len].copy_from_slice(__input);
26490 Bytes::new(&payload_buf)
26491 } else {
26492 Bytes::new(__input)
26493 };
26494 let mut __struct = Self::default();
26495 __struct.p1x = buf.get_f32_le();
26496 __struct.p1y = buf.get_f32_le();
26497 __struct.p1z = buf.get_f32_le();
26498 __struct.p2x = buf.get_f32_le();
26499 __struct.p2y = buf.get_f32_le();
26500 __struct.p2z = buf.get_f32_le();
26501 let tmp = buf.get_u8();
26502 __struct.frame =
26503 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26504 enum_type: "MavFrame",
26505 value: tmp as u32,
26506 })?;
26507 Ok(__struct)
26508 }
26509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26510 let mut __tmp = BytesMut::new(bytes);
26511 #[allow(clippy::absurd_extreme_comparisons)]
26512 #[allow(unused_comparisons)]
26513 if __tmp.remaining() < Self::ENCODED_LEN {
26514 panic!(
26515 "buffer is too small (need {} bytes, but got {})",
26516 Self::ENCODED_LEN,
26517 __tmp.remaining(),
26518 )
26519 }
26520 __tmp.put_f32_le(self.p1x);
26521 __tmp.put_f32_le(self.p1y);
26522 __tmp.put_f32_le(self.p1z);
26523 __tmp.put_f32_le(self.p2x);
26524 __tmp.put_f32_le(self.p2y);
26525 __tmp.put_f32_le(self.p2z);
26526 __tmp.put_u8(self.frame as u8);
26527 if matches!(version, MavlinkVersion::V2) {
26528 let len = __tmp.len();
26529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26530 } else {
26531 __tmp.len()
26532 }
26533 }
26534}
26535#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26536#[doc = ""]
26537#[doc = "ID: 54"]
26538#[derive(Debug, Clone, PartialEq)]
26539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26541#[cfg_attr(feature = "ts", derive(TS))]
26542#[cfg_attr(feature = "ts", ts(export))]
26543pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26544 #[doc = "x position 1 / Latitude 1"]
26545 pub p1x: f32,
26546 #[doc = "y position 1 / Longitude 1"]
26547 pub p1y: f32,
26548 #[doc = "z position 1 / Altitude 1"]
26549 pub p1z: f32,
26550 #[doc = "x position 2 / Latitude 2"]
26551 pub p2x: f32,
26552 #[doc = "y position 2 / Longitude 2"]
26553 pub p2y: f32,
26554 #[doc = "z position 2 / Altitude 2"]
26555 pub p2z: f32,
26556 #[doc = "System ID"]
26557 pub target_system: u8,
26558 #[doc = "Component ID"]
26559 pub target_component: u8,
26560 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26561 pub frame: MavFrame,
26562}
26563impl SAFETY_SET_ALLOWED_AREA_DATA {
26564 pub const ENCODED_LEN: usize = 27usize;
26565 pub const DEFAULT: Self = Self {
26566 p1x: 0.0_f32,
26567 p1y: 0.0_f32,
26568 p1z: 0.0_f32,
26569 p2x: 0.0_f32,
26570 p2y: 0.0_f32,
26571 p2z: 0.0_f32,
26572 target_system: 0_u8,
26573 target_component: 0_u8,
26574 frame: MavFrame::DEFAULT,
26575 };
26576 #[cfg(feature = "arbitrary")]
26577 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26578 use arbitrary::{Arbitrary, Unstructured};
26579 let mut buf = [0u8; 1024];
26580 rng.fill_bytes(&mut buf);
26581 let mut unstructured = Unstructured::new(&buf);
26582 Self::arbitrary(&mut unstructured).unwrap_or_default()
26583 }
26584}
26585impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26586 fn default() -> Self {
26587 Self::DEFAULT.clone()
26588 }
26589}
26590impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26591 type Message = MavMessage;
26592 const ID: u32 = 54u32;
26593 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26594 const EXTRA_CRC: u8 = 15u8;
26595 const ENCODED_LEN: usize = 27usize;
26596 fn deser(
26597 _version: MavlinkVersion,
26598 __input: &[u8],
26599 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26600 let avail_len = __input.len();
26601 let mut payload_buf = [0; Self::ENCODED_LEN];
26602 let mut buf = if avail_len < Self::ENCODED_LEN {
26603 payload_buf[0..avail_len].copy_from_slice(__input);
26604 Bytes::new(&payload_buf)
26605 } else {
26606 Bytes::new(__input)
26607 };
26608 let mut __struct = Self::default();
26609 __struct.p1x = buf.get_f32_le();
26610 __struct.p1y = buf.get_f32_le();
26611 __struct.p1z = buf.get_f32_le();
26612 __struct.p2x = buf.get_f32_le();
26613 __struct.p2y = buf.get_f32_le();
26614 __struct.p2z = buf.get_f32_le();
26615 __struct.target_system = buf.get_u8();
26616 __struct.target_component = buf.get_u8();
26617 let tmp = buf.get_u8();
26618 __struct.frame =
26619 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26620 enum_type: "MavFrame",
26621 value: tmp as u32,
26622 })?;
26623 Ok(__struct)
26624 }
26625 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26626 let mut __tmp = BytesMut::new(bytes);
26627 #[allow(clippy::absurd_extreme_comparisons)]
26628 #[allow(unused_comparisons)]
26629 if __tmp.remaining() < Self::ENCODED_LEN {
26630 panic!(
26631 "buffer is too small (need {} bytes, but got {})",
26632 Self::ENCODED_LEN,
26633 __tmp.remaining(),
26634 )
26635 }
26636 __tmp.put_f32_le(self.p1x);
26637 __tmp.put_f32_le(self.p1y);
26638 __tmp.put_f32_le(self.p1z);
26639 __tmp.put_f32_le(self.p2x);
26640 __tmp.put_f32_le(self.p2y);
26641 __tmp.put_f32_le(self.p2z);
26642 __tmp.put_u8(self.target_system);
26643 __tmp.put_u8(self.target_component);
26644 __tmp.put_u8(self.frame as u8);
26645 if matches!(version, MavlinkVersion::V2) {
26646 let len = __tmp.len();
26647 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26648 } else {
26649 __tmp.len()
26650 }
26651 }
26652}
26653#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26654#[doc = ""]
26655#[doc = "ID: 26"]
26656#[derive(Debug, Clone, PartialEq)]
26657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26659#[cfg_attr(feature = "ts", derive(TS))]
26660#[cfg_attr(feature = "ts", ts(export))]
26661pub struct SCALED_IMU_DATA {
26662 #[doc = "Timestamp (time since system boot)."]
26663 pub time_boot_ms: u32,
26664 #[doc = "X acceleration"]
26665 pub xacc: i16,
26666 #[doc = "Y acceleration"]
26667 pub yacc: i16,
26668 #[doc = "Z acceleration"]
26669 pub zacc: i16,
26670 #[doc = "Angular speed around X axis"]
26671 pub xgyro: i16,
26672 #[doc = "Angular speed around Y axis"]
26673 pub ygyro: i16,
26674 #[doc = "Angular speed around Z axis"]
26675 pub zgyro: i16,
26676 #[doc = "X Magnetic field"]
26677 pub xmag: i16,
26678 #[doc = "Y Magnetic field"]
26679 pub ymag: i16,
26680 #[doc = "Z Magnetic field"]
26681 pub zmag: i16,
26682 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26683 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26684 pub temperature: i16,
26685}
26686impl SCALED_IMU_DATA {
26687 pub const ENCODED_LEN: usize = 24usize;
26688 pub const DEFAULT: Self = Self {
26689 time_boot_ms: 0_u32,
26690 xacc: 0_i16,
26691 yacc: 0_i16,
26692 zacc: 0_i16,
26693 xgyro: 0_i16,
26694 ygyro: 0_i16,
26695 zgyro: 0_i16,
26696 xmag: 0_i16,
26697 ymag: 0_i16,
26698 zmag: 0_i16,
26699 temperature: 0_i16,
26700 };
26701 #[cfg(feature = "arbitrary")]
26702 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26703 use arbitrary::{Arbitrary, Unstructured};
26704 let mut buf = [0u8; 1024];
26705 rng.fill_bytes(&mut buf);
26706 let mut unstructured = Unstructured::new(&buf);
26707 Self::arbitrary(&mut unstructured).unwrap_or_default()
26708 }
26709}
26710impl Default for SCALED_IMU_DATA {
26711 fn default() -> Self {
26712 Self::DEFAULT.clone()
26713 }
26714}
26715impl MessageData for SCALED_IMU_DATA {
26716 type Message = MavMessage;
26717 const ID: u32 = 26u32;
26718 const NAME: &'static str = "SCALED_IMU";
26719 const EXTRA_CRC: u8 = 170u8;
26720 const ENCODED_LEN: usize = 24usize;
26721 fn deser(
26722 _version: MavlinkVersion,
26723 __input: &[u8],
26724 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26725 let avail_len = __input.len();
26726 let mut payload_buf = [0; Self::ENCODED_LEN];
26727 let mut buf = if avail_len < Self::ENCODED_LEN {
26728 payload_buf[0..avail_len].copy_from_slice(__input);
26729 Bytes::new(&payload_buf)
26730 } else {
26731 Bytes::new(__input)
26732 };
26733 let mut __struct = Self::default();
26734 __struct.time_boot_ms = buf.get_u32_le();
26735 __struct.xacc = buf.get_i16_le();
26736 __struct.yacc = buf.get_i16_le();
26737 __struct.zacc = buf.get_i16_le();
26738 __struct.xgyro = buf.get_i16_le();
26739 __struct.ygyro = buf.get_i16_le();
26740 __struct.zgyro = buf.get_i16_le();
26741 __struct.xmag = buf.get_i16_le();
26742 __struct.ymag = buf.get_i16_le();
26743 __struct.zmag = buf.get_i16_le();
26744 __struct.temperature = buf.get_i16_le();
26745 Ok(__struct)
26746 }
26747 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26748 let mut __tmp = BytesMut::new(bytes);
26749 #[allow(clippy::absurd_extreme_comparisons)]
26750 #[allow(unused_comparisons)]
26751 if __tmp.remaining() < Self::ENCODED_LEN {
26752 panic!(
26753 "buffer is too small (need {} bytes, but got {})",
26754 Self::ENCODED_LEN,
26755 __tmp.remaining(),
26756 )
26757 }
26758 __tmp.put_u32_le(self.time_boot_ms);
26759 __tmp.put_i16_le(self.xacc);
26760 __tmp.put_i16_le(self.yacc);
26761 __tmp.put_i16_le(self.zacc);
26762 __tmp.put_i16_le(self.xgyro);
26763 __tmp.put_i16_le(self.ygyro);
26764 __tmp.put_i16_le(self.zgyro);
26765 __tmp.put_i16_le(self.xmag);
26766 __tmp.put_i16_le(self.ymag);
26767 __tmp.put_i16_le(self.zmag);
26768 if matches!(version, MavlinkVersion::V2) {
26769 __tmp.put_i16_le(self.temperature);
26770 let len = __tmp.len();
26771 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26772 } else {
26773 __tmp.len()
26774 }
26775 }
26776}
26777#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26778#[doc = ""]
26779#[doc = "ID: 116"]
26780#[derive(Debug, Clone, PartialEq)]
26781#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26782#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26783#[cfg_attr(feature = "ts", derive(TS))]
26784#[cfg_attr(feature = "ts", ts(export))]
26785pub struct SCALED_IMU2_DATA {
26786 #[doc = "Timestamp (time since system boot)."]
26787 pub time_boot_ms: u32,
26788 #[doc = "X acceleration"]
26789 pub xacc: i16,
26790 #[doc = "Y acceleration"]
26791 pub yacc: i16,
26792 #[doc = "Z acceleration"]
26793 pub zacc: i16,
26794 #[doc = "Angular speed around X axis"]
26795 pub xgyro: i16,
26796 #[doc = "Angular speed around Y axis"]
26797 pub ygyro: i16,
26798 #[doc = "Angular speed around Z axis"]
26799 pub zgyro: i16,
26800 #[doc = "X Magnetic field"]
26801 pub xmag: i16,
26802 #[doc = "Y Magnetic field"]
26803 pub ymag: i16,
26804 #[doc = "Z Magnetic field"]
26805 pub zmag: i16,
26806 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26807 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26808 pub temperature: i16,
26809}
26810impl SCALED_IMU2_DATA {
26811 pub const ENCODED_LEN: usize = 24usize;
26812 pub const DEFAULT: Self = Self {
26813 time_boot_ms: 0_u32,
26814 xacc: 0_i16,
26815 yacc: 0_i16,
26816 zacc: 0_i16,
26817 xgyro: 0_i16,
26818 ygyro: 0_i16,
26819 zgyro: 0_i16,
26820 xmag: 0_i16,
26821 ymag: 0_i16,
26822 zmag: 0_i16,
26823 temperature: 0_i16,
26824 };
26825 #[cfg(feature = "arbitrary")]
26826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26827 use arbitrary::{Arbitrary, Unstructured};
26828 let mut buf = [0u8; 1024];
26829 rng.fill_bytes(&mut buf);
26830 let mut unstructured = Unstructured::new(&buf);
26831 Self::arbitrary(&mut unstructured).unwrap_or_default()
26832 }
26833}
26834impl Default for SCALED_IMU2_DATA {
26835 fn default() -> Self {
26836 Self::DEFAULT.clone()
26837 }
26838}
26839impl MessageData for SCALED_IMU2_DATA {
26840 type Message = MavMessage;
26841 const ID: u32 = 116u32;
26842 const NAME: &'static str = "SCALED_IMU2";
26843 const EXTRA_CRC: u8 = 76u8;
26844 const ENCODED_LEN: usize = 24usize;
26845 fn deser(
26846 _version: MavlinkVersion,
26847 __input: &[u8],
26848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26849 let avail_len = __input.len();
26850 let mut payload_buf = [0; Self::ENCODED_LEN];
26851 let mut buf = if avail_len < Self::ENCODED_LEN {
26852 payload_buf[0..avail_len].copy_from_slice(__input);
26853 Bytes::new(&payload_buf)
26854 } else {
26855 Bytes::new(__input)
26856 };
26857 let mut __struct = Self::default();
26858 __struct.time_boot_ms = buf.get_u32_le();
26859 __struct.xacc = buf.get_i16_le();
26860 __struct.yacc = buf.get_i16_le();
26861 __struct.zacc = buf.get_i16_le();
26862 __struct.xgyro = buf.get_i16_le();
26863 __struct.ygyro = buf.get_i16_le();
26864 __struct.zgyro = buf.get_i16_le();
26865 __struct.xmag = buf.get_i16_le();
26866 __struct.ymag = buf.get_i16_le();
26867 __struct.zmag = buf.get_i16_le();
26868 __struct.temperature = buf.get_i16_le();
26869 Ok(__struct)
26870 }
26871 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26872 let mut __tmp = BytesMut::new(bytes);
26873 #[allow(clippy::absurd_extreme_comparisons)]
26874 #[allow(unused_comparisons)]
26875 if __tmp.remaining() < Self::ENCODED_LEN {
26876 panic!(
26877 "buffer is too small (need {} bytes, but got {})",
26878 Self::ENCODED_LEN,
26879 __tmp.remaining(),
26880 )
26881 }
26882 __tmp.put_u32_le(self.time_boot_ms);
26883 __tmp.put_i16_le(self.xacc);
26884 __tmp.put_i16_le(self.yacc);
26885 __tmp.put_i16_le(self.zacc);
26886 __tmp.put_i16_le(self.xgyro);
26887 __tmp.put_i16_le(self.ygyro);
26888 __tmp.put_i16_le(self.zgyro);
26889 __tmp.put_i16_le(self.xmag);
26890 __tmp.put_i16_le(self.ymag);
26891 __tmp.put_i16_le(self.zmag);
26892 if matches!(version, MavlinkVersion::V2) {
26893 __tmp.put_i16_le(self.temperature);
26894 let len = __tmp.len();
26895 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26896 } else {
26897 __tmp.len()
26898 }
26899 }
26900}
26901#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26902#[doc = ""]
26903#[doc = "ID: 129"]
26904#[derive(Debug, Clone, PartialEq)]
26905#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26906#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26907#[cfg_attr(feature = "ts", derive(TS))]
26908#[cfg_attr(feature = "ts", ts(export))]
26909pub struct SCALED_IMU3_DATA {
26910 #[doc = "Timestamp (time since system boot)."]
26911 pub time_boot_ms: u32,
26912 #[doc = "X acceleration"]
26913 pub xacc: i16,
26914 #[doc = "Y acceleration"]
26915 pub yacc: i16,
26916 #[doc = "Z acceleration"]
26917 pub zacc: i16,
26918 #[doc = "Angular speed around X axis"]
26919 pub xgyro: i16,
26920 #[doc = "Angular speed around Y axis"]
26921 pub ygyro: i16,
26922 #[doc = "Angular speed around Z axis"]
26923 pub zgyro: i16,
26924 #[doc = "X Magnetic field"]
26925 pub xmag: i16,
26926 #[doc = "Y Magnetic field"]
26927 pub ymag: i16,
26928 #[doc = "Z Magnetic field"]
26929 pub zmag: i16,
26930 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26931 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26932 pub temperature: i16,
26933}
26934impl SCALED_IMU3_DATA {
26935 pub const ENCODED_LEN: usize = 24usize;
26936 pub const DEFAULT: Self = Self {
26937 time_boot_ms: 0_u32,
26938 xacc: 0_i16,
26939 yacc: 0_i16,
26940 zacc: 0_i16,
26941 xgyro: 0_i16,
26942 ygyro: 0_i16,
26943 zgyro: 0_i16,
26944 xmag: 0_i16,
26945 ymag: 0_i16,
26946 zmag: 0_i16,
26947 temperature: 0_i16,
26948 };
26949 #[cfg(feature = "arbitrary")]
26950 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26951 use arbitrary::{Arbitrary, Unstructured};
26952 let mut buf = [0u8; 1024];
26953 rng.fill_bytes(&mut buf);
26954 let mut unstructured = Unstructured::new(&buf);
26955 Self::arbitrary(&mut unstructured).unwrap_or_default()
26956 }
26957}
26958impl Default for SCALED_IMU3_DATA {
26959 fn default() -> Self {
26960 Self::DEFAULT.clone()
26961 }
26962}
26963impl MessageData for SCALED_IMU3_DATA {
26964 type Message = MavMessage;
26965 const ID: u32 = 129u32;
26966 const NAME: &'static str = "SCALED_IMU3";
26967 const EXTRA_CRC: u8 = 46u8;
26968 const ENCODED_LEN: usize = 24usize;
26969 fn deser(
26970 _version: MavlinkVersion,
26971 __input: &[u8],
26972 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26973 let avail_len = __input.len();
26974 let mut payload_buf = [0; Self::ENCODED_LEN];
26975 let mut buf = if avail_len < Self::ENCODED_LEN {
26976 payload_buf[0..avail_len].copy_from_slice(__input);
26977 Bytes::new(&payload_buf)
26978 } else {
26979 Bytes::new(__input)
26980 };
26981 let mut __struct = Self::default();
26982 __struct.time_boot_ms = buf.get_u32_le();
26983 __struct.xacc = buf.get_i16_le();
26984 __struct.yacc = buf.get_i16_le();
26985 __struct.zacc = buf.get_i16_le();
26986 __struct.xgyro = buf.get_i16_le();
26987 __struct.ygyro = buf.get_i16_le();
26988 __struct.zgyro = buf.get_i16_le();
26989 __struct.xmag = buf.get_i16_le();
26990 __struct.ymag = buf.get_i16_le();
26991 __struct.zmag = buf.get_i16_le();
26992 __struct.temperature = buf.get_i16_le();
26993 Ok(__struct)
26994 }
26995 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26996 let mut __tmp = BytesMut::new(bytes);
26997 #[allow(clippy::absurd_extreme_comparisons)]
26998 #[allow(unused_comparisons)]
26999 if __tmp.remaining() < Self::ENCODED_LEN {
27000 panic!(
27001 "buffer is too small (need {} bytes, but got {})",
27002 Self::ENCODED_LEN,
27003 __tmp.remaining(),
27004 )
27005 }
27006 __tmp.put_u32_le(self.time_boot_ms);
27007 __tmp.put_i16_le(self.xacc);
27008 __tmp.put_i16_le(self.yacc);
27009 __tmp.put_i16_le(self.zacc);
27010 __tmp.put_i16_le(self.xgyro);
27011 __tmp.put_i16_le(self.ygyro);
27012 __tmp.put_i16_le(self.zgyro);
27013 __tmp.put_i16_le(self.xmag);
27014 __tmp.put_i16_le(self.ymag);
27015 __tmp.put_i16_le(self.zmag);
27016 if matches!(version, MavlinkVersion::V2) {
27017 __tmp.put_i16_le(self.temperature);
27018 let len = __tmp.len();
27019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27020 } else {
27021 __tmp.len()
27022 }
27023 }
27024}
27025#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27026#[doc = ""]
27027#[doc = "ID: 29"]
27028#[derive(Debug, Clone, PartialEq)]
27029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27031#[cfg_attr(feature = "ts", derive(TS))]
27032#[cfg_attr(feature = "ts", ts(export))]
27033pub struct SCALED_PRESSURE_DATA {
27034 #[doc = "Timestamp (time since system boot)."]
27035 pub time_boot_ms: u32,
27036 #[doc = "Absolute pressure"]
27037 pub press_abs: f32,
27038 #[doc = "Differential pressure 1"]
27039 pub press_diff: f32,
27040 #[doc = "Absolute pressure temperature"]
27041 pub temperature: i16,
27042 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27043 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27044 pub temperature_press_diff: i16,
27045}
27046impl SCALED_PRESSURE_DATA {
27047 pub const ENCODED_LEN: usize = 16usize;
27048 pub const DEFAULT: Self = Self {
27049 time_boot_ms: 0_u32,
27050 press_abs: 0.0_f32,
27051 press_diff: 0.0_f32,
27052 temperature: 0_i16,
27053 temperature_press_diff: 0_i16,
27054 };
27055 #[cfg(feature = "arbitrary")]
27056 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27057 use arbitrary::{Arbitrary, Unstructured};
27058 let mut buf = [0u8; 1024];
27059 rng.fill_bytes(&mut buf);
27060 let mut unstructured = Unstructured::new(&buf);
27061 Self::arbitrary(&mut unstructured).unwrap_or_default()
27062 }
27063}
27064impl Default for SCALED_PRESSURE_DATA {
27065 fn default() -> Self {
27066 Self::DEFAULT.clone()
27067 }
27068}
27069impl MessageData for SCALED_PRESSURE_DATA {
27070 type Message = MavMessage;
27071 const ID: u32 = 29u32;
27072 const NAME: &'static str = "SCALED_PRESSURE";
27073 const EXTRA_CRC: u8 = 115u8;
27074 const ENCODED_LEN: usize = 16usize;
27075 fn deser(
27076 _version: MavlinkVersion,
27077 __input: &[u8],
27078 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27079 let avail_len = __input.len();
27080 let mut payload_buf = [0; Self::ENCODED_LEN];
27081 let mut buf = if avail_len < Self::ENCODED_LEN {
27082 payload_buf[0..avail_len].copy_from_slice(__input);
27083 Bytes::new(&payload_buf)
27084 } else {
27085 Bytes::new(__input)
27086 };
27087 let mut __struct = Self::default();
27088 __struct.time_boot_ms = buf.get_u32_le();
27089 __struct.press_abs = buf.get_f32_le();
27090 __struct.press_diff = buf.get_f32_le();
27091 __struct.temperature = buf.get_i16_le();
27092 __struct.temperature_press_diff = buf.get_i16_le();
27093 Ok(__struct)
27094 }
27095 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27096 let mut __tmp = BytesMut::new(bytes);
27097 #[allow(clippy::absurd_extreme_comparisons)]
27098 #[allow(unused_comparisons)]
27099 if __tmp.remaining() < Self::ENCODED_LEN {
27100 panic!(
27101 "buffer is too small (need {} bytes, but got {})",
27102 Self::ENCODED_LEN,
27103 __tmp.remaining(),
27104 )
27105 }
27106 __tmp.put_u32_le(self.time_boot_ms);
27107 __tmp.put_f32_le(self.press_abs);
27108 __tmp.put_f32_le(self.press_diff);
27109 __tmp.put_i16_le(self.temperature);
27110 if matches!(version, MavlinkVersion::V2) {
27111 __tmp.put_i16_le(self.temperature_press_diff);
27112 let len = __tmp.len();
27113 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27114 } else {
27115 __tmp.len()
27116 }
27117 }
27118}
27119#[doc = "Barometer readings for 2nd barometer."]
27120#[doc = ""]
27121#[doc = "ID: 137"]
27122#[derive(Debug, Clone, PartialEq)]
27123#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27124#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27125#[cfg_attr(feature = "ts", derive(TS))]
27126#[cfg_attr(feature = "ts", ts(export))]
27127pub struct SCALED_PRESSURE2_DATA {
27128 #[doc = "Timestamp (time since system boot)."]
27129 pub time_boot_ms: u32,
27130 #[doc = "Absolute pressure"]
27131 pub press_abs: f32,
27132 #[doc = "Differential pressure"]
27133 pub press_diff: f32,
27134 #[doc = "Absolute pressure temperature"]
27135 pub temperature: i16,
27136 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27137 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27138 pub temperature_press_diff: i16,
27139}
27140impl SCALED_PRESSURE2_DATA {
27141 pub const ENCODED_LEN: usize = 16usize;
27142 pub const DEFAULT: Self = Self {
27143 time_boot_ms: 0_u32,
27144 press_abs: 0.0_f32,
27145 press_diff: 0.0_f32,
27146 temperature: 0_i16,
27147 temperature_press_diff: 0_i16,
27148 };
27149 #[cfg(feature = "arbitrary")]
27150 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27151 use arbitrary::{Arbitrary, Unstructured};
27152 let mut buf = [0u8; 1024];
27153 rng.fill_bytes(&mut buf);
27154 let mut unstructured = Unstructured::new(&buf);
27155 Self::arbitrary(&mut unstructured).unwrap_or_default()
27156 }
27157}
27158impl Default for SCALED_PRESSURE2_DATA {
27159 fn default() -> Self {
27160 Self::DEFAULT.clone()
27161 }
27162}
27163impl MessageData for SCALED_PRESSURE2_DATA {
27164 type Message = MavMessage;
27165 const ID: u32 = 137u32;
27166 const NAME: &'static str = "SCALED_PRESSURE2";
27167 const EXTRA_CRC: u8 = 195u8;
27168 const ENCODED_LEN: usize = 16usize;
27169 fn deser(
27170 _version: MavlinkVersion,
27171 __input: &[u8],
27172 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27173 let avail_len = __input.len();
27174 let mut payload_buf = [0; Self::ENCODED_LEN];
27175 let mut buf = if avail_len < Self::ENCODED_LEN {
27176 payload_buf[0..avail_len].copy_from_slice(__input);
27177 Bytes::new(&payload_buf)
27178 } else {
27179 Bytes::new(__input)
27180 };
27181 let mut __struct = Self::default();
27182 __struct.time_boot_ms = buf.get_u32_le();
27183 __struct.press_abs = buf.get_f32_le();
27184 __struct.press_diff = buf.get_f32_le();
27185 __struct.temperature = buf.get_i16_le();
27186 __struct.temperature_press_diff = buf.get_i16_le();
27187 Ok(__struct)
27188 }
27189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27190 let mut __tmp = BytesMut::new(bytes);
27191 #[allow(clippy::absurd_extreme_comparisons)]
27192 #[allow(unused_comparisons)]
27193 if __tmp.remaining() < Self::ENCODED_LEN {
27194 panic!(
27195 "buffer is too small (need {} bytes, but got {})",
27196 Self::ENCODED_LEN,
27197 __tmp.remaining(),
27198 )
27199 }
27200 __tmp.put_u32_le(self.time_boot_ms);
27201 __tmp.put_f32_le(self.press_abs);
27202 __tmp.put_f32_le(self.press_diff);
27203 __tmp.put_i16_le(self.temperature);
27204 if matches!(version, MavlinkVersion::V2) {
27205 __tmp.put_i16_le(self.temperature_press_diff);
27206 let len = __tmp.len();
27207 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27208 } else {
27209 __tmp.len()
27210 }
27211 }
27212}
27213#[doc = "Barometer readings for 3rd barometer."]
27214#[doc = ""]
27215#[doc = "ID: 143"]
27216#[derive(Debug, Clone, PartialEq)]
27217#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27218#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27219#[cfg_attr(feature = "ts", derive(TS))]
27220#[cfg_attr(feature = "ts", ts(export))]
27221pub struct SCALED_PRESSURE3_DATA {
27222 #[doc = "Timestamp (time since system boot)."]
27223 pub time_boot_ms: u32,
27224 #[doc = "Absolute pressure"]
27225 pub press_abs: f32,
27226 #[doc = "Differential pressure"]
27227 pub press_diff: f32,
27228 #[doc = "Absolute pressure temperature"]
27229 pub temperature: i16,
27230 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27231 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27232 pub temperature_press_diff: i16,
27233}
27234impl SCALED_PRESSURE3_DATA {
27235 pub const ENCODED_LEN: usize = 16usize;
27236 pub const DEFAULT: Self = Self {
27237 time_boot_ms: 0_u32,
27238 press_abs: 0.0_f32,
27239 press_diff: 0.0_f32,
27240 temperature: 0_i16,
27241 temperature_press_diff: 0_i16,
27242 };
27243 #[cfg(feature = "arbitrary")]
27244 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27245 use arbitrary::{Arbitrary, Unstructured};
27246 let mut buf = [0u8; 1024];
27247 rng.fill_bytes(&mut buf);
27248 let mut unstructured = Unstructured::new(&buf);
27249 Self::arbitrary(&mut unstructured).unwrap_or_default()
27250 }
27251}
27252impl Default for SCALED_PRESSURE3_DATA {
27253 fn default() -> Self {
27254 Self::DEFAULT.clone()
27255 }
27256}
27257impl MessageData for SCALED_PRESSURE3_DATA {
27258 type Message = MavMessage;
27259 const ID: u32 = 143u32;
27260 const NAME: &'static str = "SCALED_PRESSURE3";
27261 const EXTRA_CRC: u8 = 131u8;
27262 const ENCODED_LEN: usize = 16usize;
27263 fn deser(
27264 _version: MavlinkVersion,
27265 __input: &[u8],
27266 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27267 let avail_len = __input.len();
27268 let mut payload_buf = [0; Self::ENCODED_LEN];
27269 let mut buf = if avail_len < Self::ENCODED_LEN {
27270 payload_buf[0..avail_len].copy_from_slice(__input);
27271 Bytes::new(&payload_buf)
27272 } else {
27273 Bytes::new(__input)
27274 };
27275 let mut __struct = Self::default();
27276 __struct.time_boot_ms = buf.get_u32_le();
27277 __struct.press_abs = buf.get_f32_le();
27278 __struct.press_diff = buf.get_f32_le();
27279 __struct.temperature = buf.get_i16_le();
27280 __struct.temperature_press_diff = buf.get_i16_le();
27281 Ok(__struct)
27282 }
27283 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27284 let mut __tmp = BytesMut::new(bytes);
27285 #[allow(clippy::absurd_extreme_comparisons)]
27286 #[allow(unused_comparisons)]
27287 if __tmp.remaining() < Self::ENCODED_LEN {
27288 panic!(
27289 "buffer is too small (need {} bytes, but got {})",
27290 Self::ENCODED_LEN,
27291 __tmp.remaining(),
27292 )
27293 }
27294 __tmp.put_u32_le(self.time_boot_ms);
27295 __tmp.put_f32_le(self.press_abs);
27296 __tmp.put_f32_le(self.press_diff);
27297 __tmp.put_i16_le(self.temperature);
27298 if matches!(version, MavlinkVersion::V2) {
27299 __tmp.put_i16_le(self.temperature_press_diff);
27300 let len = __tmp.len();
27301 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27302 } else {
27303 __tmp.len()
27304 }
27305 }
27306}
27307#[doc = "This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts."]
27308#[doc = ""]
27309#[doc = "ID: 183"]
27310#[derive(Debug, Clone, PartialEq)]
27311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27312#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27313#[cfg_attr(feature = "ts", derive(TS))]
27314#[cfg_attr(feature = "ts", ts(export))]
27315pub struct SCRIPT_COUNT_DATA {
27316 #[doc = "Number of script items in the sequence"]
27317 pub count: u16,
27318 #[doc = "System ID"]
27319 pub target_system: u8,
27320 #[doc = "Component ID"]
27321 pub target_component: u8,
27322}
27323impl SCRIPT_COUNT_DATA {
27324 pub const ENCODED_LEN: usize = 4usize;
27325 pub const DEFAULT: Self = Self {
27326 count: 0_u16,
27327 target_system: 0_u8,
27328 target_component: 0_u8,
27329 };
27330 #[cfg(feature = "arbitrary")]
27331 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27332 use arbitrary::{Arbitrary, Unstructured};
27333 let mut buf = [0u8; 1024];
27334 rng.fill_bytes(&mut buf);
27335 let mut unstructured = Unstructured::new(&buf);
27336 Self::arbitrary(&mut unstructured).unwrap_or_default()
27337 }
27338}
27339impl Default for SCRIPT_COUNT_DATA {
27340 fn default() -> Self {
27341 Self::DEFAULT.clone()
27342 }
27343}
27344impl MessageData for SCRIPT_COUNT_DATA {
27345 type Message = MavMessage;
27346 const ID: u32 = 183u32;
27347 const NAME: &'static str = "SCRIPT_COUNT";
27348 const EXTRA_CRC: u8 = 186u8;
27349 const ENCODED_LEN: usize = 4usize;
27350 fn deser(
27351 _version: MavlinkVersion,
27352 __input: &[u8],
27353 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27354 let avail_len = __input.len();
27355 let mut payload_buf = [0; Self::ENCODED_LEN];
27356 let mut buf = if avail_len < Self::ENCODED_LEN {
27357 payload_buf[0..avail_len].copy_from_slice(__input);
27358 Bytes::new(&payload_buf)
27359 } else {
27360 Bytes::new(__input)
27361 };
27362 let mut __struct = Self::default();
27363 __struct.count = buf.get_u16_le();
27364 __struct.target_system = buf.get_u8();
27365 __struct.target_component = buf.get_u8();
27366 Ok(__struct)
27367 }
27368 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27369 let mut __tmp = BytesMut::new(bytes);
27370 #[allow(clippy::absurd_extreme_comparisons)]
27371 #[allow(unused_comparisons)]
27372 if __tmp.remaining() < Self::ENCODED_LEN {
27373 panic!(
27374 "buffer is too small (need {} bytes, but got {})",
27375 Self::ENCODED_LEN,
27376 __tmp.remaining(),
27377 )
27378 }
27379 __tmp.put_u16_le(self.count);
27380 __tmp.put_u8(self.target_system);
27381 __tmp.put_u8(self.target_component);
27382 if matches!(version, MavlinkVersion::V2) {
27383 let len = __tmp.len();
27384 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27385 } else {
27386 __tmp.len()
27387 }
27388 }
27389}
27390#[doc = "This message informs about the currently active SCRIPT."]
27391#[doc = ""]
27392#[doc = "ID: 184"]
27393#[derive(Debug, Clone, PartialEq)]
27394#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27396#[cfg_attr(feature = "ts", derive(TS))]
27397#[cfg_attr(feature = "ts", ts(export))]
27398pub struct SCRIPT_CURRENT_DATA {
27399 #[doc = "Active Sequence"]
27400 pub seq: u16,
27401}
27402impl SCRIPT_CURRENT_DATA {
27403 pub const ENCODED_LEN: usize = 2usize;
27404 pub const DEFAULT: Self = Self { seq: 0_u16 };
27405 #[cfg(feature = "arbitrary")]
27406 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27407 use arbitrary::{Arbitrary, Unstructured};
27408 let mut buf = [0u8; 1024];
27409 rng.fill_bytes(&mut buf);
27410 let mut unstructured = Unstructured::new(&buf);
27411 Self::arbitrary(&mut unstructured).unwrap_or_default()
27412 }
27413}
27414impl Default for SCRIPT_CURRENT_DATA {
27415 fn default() -> Self {
27416 Self::DEFAULT.clone()
27417 }
27418}
27419impl MessageData for SCRIPT_CURRENT_DATA {
27420 type Message = MavMessage;
27421 const ID: u32 = 184u32;
27422 const NAME: &'static str = "SCRIPT_CURRENT";
27423 const EXTRA_CRC: u8 = 40u8;
27424 const ENCODED_LEN: usize = 2usize;
27425 fn deser(
27426 _version: MavlinkVersion,
27427 __input: &[u8],
27428 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27429 let avail_len = __input.len();
27430 let mut payload_buf = [0; Self::ENCODED_LEN];
27431 let mut buf = if avail_len < Self::ENCODED_LEN {
27432 payload_buf[0..avail_len].copy_from_slice(__input);
27433 Bytes::new(&payload_buf)
27434 } else {
27435 Bytes::new(__input)
27436 };
27437 let mut __struct = Self::default();
27438 __struct.seq = buf.get_u16_le();
27439 Ok(__struct)
27440 }
27441 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27442 let mut __tmp = BytesMut::new(bytes);
27443 #[allow(clippy::absurd_extreme_comparisons)]
27444 #[allow(unused_comparisons)]
27445 if __tmp.remaining() < Self::ENCODED_LEN {
27446 panic!(
27447 "buffer is too small (need {} bytes, but got {})",
27448 Self::ENCODED_LEN,
27449 __tmp.remaining(),
27450 )
27451 }
27452 __tmp.put_u16_le(self.seq);
27453 if matches!(version, MavlinkVersion::V2) {
27454 let len = __tmp.len();
27455 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27456 } else {
27457 __tmp.len()
27458 }
27459 }
27460}
27461#[doc = "Message encoding a mission script item. This message is emitted upon a request for the next script item."]
27462#[doc = ""]
27463#[doc = "ID: 180"]
27464#[derive(Debug, Clone, PartialEq)]
27465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27467#[cfg_attr(feature = "ts", derive(TS))]
27468#[cfg_attr(feature = "ts", ts(export))]
27469pub struct SCRIPT_ITEM_DATA {
27470 #[doc = "Sequence"]
27471 pub seq: u16,
27472 #[doc = "System ID"]
27473 pub target_system: u8,
27474 #[doc = "Component ID"]
27475 pub target_component: u8,
27476 #[doc = "The name of the mission script, NULL terminated."]
27477 #[cfg_attr(
27478 feature = "serde",
27479 serde(
27480 serialize_with = "crate::nulstr::serialize::<_, 50>",
27481 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
27482 )
27483 )]
27484 #[cfg_attr(feature = "ts", ts(type = "string"))]
27485 pub name: [u8; 50],
27486}
27487impl SCRIPT_ITEM_DATA {
27488 pub const ENCODED_LEN: usize = 54usize;
27489 pub const DEFAULT: Self = Self {
27490 seq: 0_u16,
27491 target_system: 0_u8,
27492 target_component: 0_u8,
27493 name: [0_u8; 50usize],
27494 };
27495 #[cfg(feature = "arbitrary")]
27496 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27497 use arbitrary::{Arbitrary, Unstructured};
27498 let mut buf = [0u8; 1024];
27499 rng.fill_bytes(&mut buf);
27500 let mut unstructured = Unstructured::new(&buf);
27501 Self::arbitrary(&mut unstructured).unwrap_or_default()
27502 }
27503}
27504impl Default for SCRIPT_ITEM_DATA {
27505 fn default() -> Self {
27506 Self::DEFAULT.clone()
27507 }
27508}
27509impl MessageData for SCRIPT_ITEM_DATA {
27510 type Message = MavMessage;
27511 const ID: u32 = 180u32;
27512 const NAME: &'static str = "SCRIPT_ITEM";
27513 const EXTRA_CRC: u8 = 231u8;
27514 const ENCODED_LEN: usize = 54usize;
27515 fn deser(
27516 _version: MavlinkVersion,
27517 __input: &[u8],
27518 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27519 let avail_len = __input.len();
27520 let mut payload_buf = [0; Self::ENCODED_LEN];
27521 let mut buf = if avail_len < Self::ENCODED_LEN {
27522 payload_buf[0..avail_len].copy_from_slice(__input);
27523 Bytes::new(&payload_buf)
27524 } else {
27525 Bytes::new(__input)
27526 };
27527 let mut __struct = Self::default();
27528 __struct.seq = buf.get_u16_le();
27529 __struct.target_system = buf.get_u8();
27530 __struct.target_component = buf.get_u8();
27531 for v in &mut __struct.name {
27532 let val = buf.get_u8();
27533 *v = val;
27534 }
27535 Ok(__struct)
27536 }
27537 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27538 let mut __tmp = BytesMut::new(bytes);
27539 #[allow(clippy::absurd_extreme_comparisons)]
27540 #[allow(unused_comparisons)]
27541 if __tmp.remaining() < Self::ENCODED_LEN {
27542 panic!(
27543 "buffer is too small (need {} bytes, but got {})",
27544 Self::ENCODED_LEN,
27545 __tmp.remaining(),
27546 )
27547 }
27548 __tmp.put_u16_le(self.seq);
27549 __tmp.put_u8(self.target_system);
27550 __tmp.put_u8(self.target_component);
27551 for val in &self.name {
27552 __tmp.put_u8(*val);
27553 }
27554 if matches!(version, MavlinkVersion::V2) {
27555 let len = __tmp.len();
27556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27557 } else {
27558 __tmp.len()
27559 }
27560 }
27561}
27562#[doc = "Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message."]
27563#[doc = ""]
27564#[doc = "ID: 181"]
27565#[derive(Debug, Clone, PartialEq)]
27566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27568#[cfg_attr(feature = "ts", derive(TS))]
27569#[cfg_attr(feature = "ts", ts(export))]
27570pub struct SCRIPT_REQUEST_DATA {
27571 #[doc = "Sequence"]
27572 pub seq: u16,
27573 #[doc = "System ID"]
27574 pub target_system: u8,
27575 #[doc = "Component ID"]
27576 pub target_component: u8,
27577}
27578impl SCRIPT_REQUEST_DATA {
27579 pub const ENCODED_LEN: usize = 4usize;
27580 pub const DEFAULT: Self = Self {
27581 seq: 0_u16,
27582 target_system: 0_u8,
27583 target_component: 0_u8,
27584 };
27585 #[cfg(feature = "arbitrary")]
27586 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27587 use arbitrary::{Arbitrary, Unstructured};
27588 let mut buf = [0u8; 1024];
27589 rng.fill_bytes(&mut buf);
27590 let mut unstructured = Unstructured::new(&buf);
27591 Self::arbitrary(&mut unstructured).unwrap_or_default()
27592 }
27593}
27594impl Default for SCRIPT_REQUEST_DATA {
27595 fn default() -> Self {
27596 Self::DEFAULT.clone()
27597 }
27598}
27599impl MessageData for SCRIPT_REQUEST_DATA {
27600 type Message = MavMessage;
27601 const ID: u32 = 181u32;
27602 const NAME: &'static str = "SCRIPT_REQUEST";
27603 const EXTRA_CRC: u8 = 129u8;
27604 const ENCODED_LEN: usize = 4usize;
27605 fn deser(
27606 _version: MavlinkVersion,
27607 __input: &[u8],
27608 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27609 let avail_len = __input.len();
27610 let mut payload_buf = [0; Self::ENCODED_LEN];
27611 let mut buf = if avail_len < Self::ENCODED_LEN {
27612 payload_buf[0..avail_len].copy_from_slice(__input);
27613 Bytes::new(&payload_buf)
27614 } else {
27615 Bytes::new(__input)
27616 };
27617 let mut __struct = Self::default();
27618 __struct.seq = buf.get_u16_le();
27619 __struct.target_system = buf.get_u8();
27620 __struct.target_component = buf.get_u8();
27621 Ok(__struct)
27622 }
27623 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27624 let mut __tmp = BytesMut::new(bytes);
27625 #[allow(clippy::absurd_extreme_comparisons)]
27626 #[allow(unused_comparisons)]
27627 if __tmp.remaining() < Self::ENCODED_LEN {
27628 panic!(
27629 "buffer is too small (need {} bytes, but got {})",
27630 Self::ENCODED_LEN,
27631 __tmp.remaining(),
27632 )
27633 }
27634 __tmp.put_u16_le(self.seq);
27635 __tmp.put_u8(self.target_system);
27636 __tmp.put_u8(self.target_component);
27637 if matches!(version, MavlinkVersion::V2) {
27638 let len = __tmp.len();
27639 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27640 } else {
27641 __tmp.len()
27642 }
27643 }
27644}
27645#[doc = "Request the overall list of mission items from the system/component."]
27646#[doc = ""]
27647#[doc = "ID: 182"]
27648#[derive(Debug, Clone, PartialEq)]
27649#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27650#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27651#[cfg_attr(feature = "ts", derive(TS))]
27652#[cfg_attr(feature = "ts", ts(export))]
27653pub struct SCRIPT_REQUEST_LIST_DATA {
27654 #[doc = "System ID"]
27655 pub target_system: u8,
27656 #[doc = "Component ID"]
27657 pub target_component: u8,
27658}
27659impl SCRIPT_REQUEST_LIST_DATA {
27660 pub const ENCODED_LEN: usize = 2usize;
27661 pub const DEFAULT: Self = Self {
27662 target_system: 0_u8,
27663 target_component: 0_u8,
27664 };
27665 #[cfg(feature = "arbitrary")]
27666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27667 use arbitrary::{Arbitrary, Unstructured};
27668 let mut buf = [0u8; 1024];
27669 rng.fill_bytes(&mut buf);
27670 let mut unstructured = Unstructured::new(&buf);
27671 Self::arbitrary(&mut unstructured).unwrap_or_default()
27672 }
27673}
27674impl Default for SCRIPT_REQUEST_LIST_DATA {
27675 fn default() -> Self {
27676 Self::DEFAULT.clone()
27677 }
27678}
27679impl MessageData for SCRIPT_REQUEST_LIST_DATA {
27680 type Message = MavMessage;
27681 const ID: u32 = 182u32;
27682 const NAME: &'static str = "SCRIPT_REQUEST_LIST";
27683 const EXTRA_CRC: u8 = 115u8;
27684 const ENCODED_LEN: usize = 2usize;
27685 fn deser(
27686 _version: MavlinkVersion,
27687 __input: &[u8],
27688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27689 let avail_len = __input.len();
27690 let mut payload_buf = [0; Self::ENCODED_LEN];
27691 let mut buf = if avail_len < Self::ENCODED_LEN {
27692 payload_buf[0..avail_len].copy_from_slice(__input);
27693 Bytes::new(&payload_buf)
27694 } else {
27695 Bytes::new(__input)
27696 };
27697 let mut __struct = Self::default();
27698 __struct.target_system = buf.get_u8();
27699 __struct.target_component = buf.get_u8();
27700 Ok(__struct)
27701 }
27702 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27703 let mut __tmp = BytesMut::new(bytes);
27704 #[allow(clippy::absurd_extreme_comparisons)]
27705 #[allow(unused_comparisons)]
27706 if __tmp.remaining() < Self::ENCODED_LEN {
27707 panic!(
27708 "buffer is too small (need {} bytes, but got {})",
27709 Self::ENCODED_LEN,
27710 __tmp.remaining(),
27711 )
27712 }
27713 __tmp.put_u8(self.target_system);
27714 __tmp.put_u8(self.target_component);
27715 if matches!(version, MavlinkVersion::V2) {
27716 let len = __tmp.len();
27717 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27718 } else {
27719 __tmp.len()
27720 }
27721 }
27722}
27723#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27724#[doc = ""]
27725#[doc = "ID: 126"]
27726#[derive(Debug, Clone, PartialEq)]
27727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27729#[cfg_attr(feature = "ts", derive(TS))]
27730#[cfg_attr(feature = "ts", ts(export))]
27731pub struct SERIAL_CONTROL_DATA {
27732 #[doc = "Baudrate of transfer. Zero means no change."]
27733 pub baudrate: u32,
27734 #[doc = "Timeout for reply data"]
27735 pub timeout: u16,
27736 #[doc = "Serial control device type."]
27737 pub device: SerialControlDev,
27738 #[doc = "Bitmap of serial control flags."]
27739 pub flags: SerialControlFlag,
27740 #[doc = "how many bytes in this transfer"]
27741 pub count: u8,
27742 #[doc = "serial data"]
27743 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27744 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27745 pub data: [u8; 70],
27746 #[doc = "System ID"]
27747 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27748 pub target_system: u8,
27749 #[doc = "Component ID"]
27750 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27751 pub target_component: u8,
27752}
27753impl SERIAL_CONTROL_DATA {
27754 pub const ENCODED_LEN: usize = 81usize;
27755 pub const DEFAULT: Self = Self {
27756 baudrate: 0_u32,
27757 timeout: 0_u16,
27758 device: SerialControlDev::DEFAULT,
27759 flags: SerialControlFlag::DEFAULT,
27760 count: 0_u8,
27761 data: [0_u8; 70usize],
27762 target_system: 0_u8,
27763 target_component: 0_u8,
27764 };
27765 #[cfg(feature = "arbitrary")]
27766 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27767 use arbitrary::{Arbitrary, Unstructured};
27768 let mut buf = [0u8; 1024];
27769 rng.fill_bytes(&mut buf);
27770 let mut unstructured = Unstructured::new(&buf);
27771 Self::arbitrary(&mut unstructured).unwrap_or_default()
27772 }
27773}
27774impl Default for SERIAL_CONTROL_DATA {
27775 fn default() -> Self {
27776 Self::DEFAULT.clone()
27777 }
27778}
27779impl MessageData for SERIAL_CONTROL_DATA {
27780 type Message = MavMessage;
27781 const ID: u32 = 126u32;
27782 const NAME: &'static str = "SERIAL_CONTROL";
27783 const EXTRA_CRC: u8 = 220u8;
27784 const ENCODED_LEN: usize = 81usize;
27785 fn deser(
27786 _version: MavlinkVersion,
27787 __input: &[u8],
27788 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27789 let avail_len = __input.len();
27790 let mut payload_buf = [0; Self::ENCODED_LEN];
27791 let mut buf = if avail_len < Self::ENCODED_LEN {
27792 payload_buf[0..avail_len].copy_from_slice(__input);
27793 Bytes::new(&payload_buf)
27794 } else {
27795 Bytes::new(__input)
27796 };
27797 let mut __struct = Self::default();
27798 __struct.baudrate = buf.get_u32_le();
27799 __struct.timeout = buf.get_u16_le();
27800 let tmp = buf.get_u8();
27801 __struct.device =
27802 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27803 enum_type: "SerialControlDev",
27804 value: tmp as u32,
27805 })?;
27806 let tmp = buf.get_u8();
27807 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
27808 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27809 flag_type: "SerialControlFlag",
27810 value: tmp as u32,
27811 })?;
27812 __struct.count = buf.get_u8();
27813 for v in &mut __struct.data {
27814 let val = buf.get_u8();
27815 *v = val;
27816 }
27817 __struct.target_system = buf.get_u8();
27818 __struct.target_component = buf.get_u8();
27819 Ok(__struct)
27820 }
27821 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27822 let mut __tmp = BytesMut::new(bytes);
27823 #[allow(clippy::absurd_extreme_comparisons)]
27824 #[allow(unused_comparisons)]
27825 if __tmp.remaining() < Self::ENCODED_LEN {
27826 panic!(
27827 "buffer is too small (need {} bytes, but got {})",
27828 Self::ENCODED_LEN,
27829 __tmp.remaining(),
27830 )
27831 }
27832 __tmp.put_u32_le(self.baudrate);
27833 __tmp.put_u16_le(self.timeout);
27834 __tmp.put_u8(self.device as u8);
27835 __tmp.put_u8(self.flags.bits());
27836 __tmp.put_u8(self.count);
27837 for val in &self.data {
27838 __tmp.put_u8(*val);
27839 }
27840 if matches!(version, MavlinkVersion::V2) {
27841 __tmp.put_u8(self.target_system);
27842 __tmp.put_u8(self.target_component);
27843 let len = __tmp.len();
27844 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27845 } else {
27846 __tmp.len()
27847 }
27848 }
27849}
27850#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27851#[doc = ""]
27852#[doc = "ID: 36"]
27853#[derive(Debug, Clone, PartialEq)]
27854#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27856#[cfg_attr(feature = "ts", derive(TS))]
27857#[cfg_attr(feature = "ts", ts(export))]
27858pub struct SERVO_OUTPUT_RAW_DATA {
27859 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27860 pub time_usec: u32,
27861 #[doc = "Servo output 1 value"]
27862 pub servo1_raw: u16,
27863 #[doc = "Servo output 2 value"]
27864 pub servo2_raw: u16,
27865 #[doc = "Servo output 3 value"]
27866 pub servo3_raw: u16,
27867 #[doc = "Servo output 4 value"]
27868 pub servo4_raw: u16,
27869 #[doc = "Servo output 5 value"]
27870 pub servo5_raw: u16,
27871 #[doc = "Servo output 6 value"]
27872 pub servo6_raw: u16,
27873 #[doc = "Servo output 7 value"]
27874 pub servo7_raw: u16,
27875 #[doc = "Servo output 8 value"]
27876 pub servo8_raw: u16,
27877 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27878 pub port: u8,
27879 #[doc = "Servo output 9 value"]
27880 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27881 pub servo9_raw: u16,
27882 #[doc = "Servo output 10 value"]
27883 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27884 pub servo10_raw: u16,
27885 #[doc = "Servo output 11 value"]
27886 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27887 pub servo11_raw: u16,
27888 #[doc = "Servo output 12 value"]
27889 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27890 pub servo12_raw: u16,
27891 #[doc = "Servo output 13 value"]
27892 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27893 pub servo13_raw: u16,
27894 #[doc = "Servo output 14 value"]
27895 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27896 pub servo14_raw: u16,
27897 #[doc = "Servo output 15 value"]
27898 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27899 pub servo15_raw: u16,
27900 #[doc = "Servo output 16 value"]
27901 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27902 pub servo16_raw: u16,
27903}
27904impl SERVO_OUTPUT_RAW_DATA {
27905 pub const ENCODED_LEN: usize = 37usize;
27906 pub const DEFAULT: Self = Self {
27907 time_usec: 0_u32,
27908 servo1_raw: 0_u16,
27909 servo2_raw: 0_u16,
27910 servo3_raw: 0_u16,
27911 servo4_raw: 0_u16,
27912 servo5_raw: 0_u16,
27913 servo6_raw: 0_u16,
27914 servo7_raw: 0_u16,
27915 servo8_raw: 0_u16,
27916 port: 0_u8,
27917 servo9_raw: 0_u16,
27918 servo10_raw: 0_u16,
27919 servo11_raw: 0_u16,
27920 servo12_raw: 0_u16,
27921 servo13_raw: 0_u16,
27922 servo14_raw: 0_u16,
27923 servo15_raw: 0_u16,
27924 servo16_raw: 0_u16,
27925 };
27926 #[cfg(feature = "arbitrary")]
27927 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27928 use arbitrary::{Arbitrary, Unstructured};
27929 let mut buf = [0u8; 1024];
27930 rng.fill_bytes(&mut buf);
27931 let mut unstructured = Unstructured::new(&buf);
27932 Self::arbitrary(&mut unstructured).unwrap_or_default()
27933 }
27934}
27935impl Default for SERVO_OUTPUT_RAW_DATA {
27936 fn default() -> Self {
27937 Self::DEFAULT.clone()
27938 }
27939}
27940impl MessageData for SERVO_OUTPUT_RAW_DATA {
27941 type Message = MavMessage;
27942 const ID: u32 = 36u32;
27943 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27944 const EXTRA_CRC: u8 = 222u8;
27945 const ENCODED_LEN: usize = 37usize;
27946 fn deser(
27947 _version: MavlinkVersion,
27948 __input: &[u8],
27949 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27950 let avail_len = __input.len();
27951 let mut payload_buf = [0; Self::ENCODED_LEN];
27952 let mut buf = if avail_len < Self::ENCODED_LEN {
27953 payload_buf[0..avail_len].copy_from_slice(__input);
27954 Bytes::new(&payload_buf)
27955 } else {
27956 Bytes::new(__input)
27957 };
27958 let mut __struct = Self::default();
27959 __struct.time_usec = buf.get_u32_le();
27960 __struct.servo1_raw = buf.get_u16_le();
27961 __struct.servo2_raw = buf.get_u16_le();
27962 __struct.servo3_raw = buf.get_u16_le();
27963 __struct.servo4_raw = buf.get_u16_le();
27964 __struct.servo5_raw = buf.get_u16_le();
27965 __struct.servo6_raw = buf.get_u16_le();
27966 __struct.servo7_raw = buf.get_u16_le();
27967 __struct.servo8_raw = buf.get_u16_le();
27968 __struct.port = buf.get_u8();
27969 __struct.servo9_raw = buf.get_u16_le();
27970 __struct.servo10_raw = buf.get_u16_le();
27971 __struct.servo11_raw = buf.get_u16_le();
27972 __struct.servo12_raw = buf.get_u16_le();
27973 __struct.servo13_raw = buf.get_u16_le();
27974 __struct.servo14_raw = buf.get_u16_le();
27975 __struct.servo15_raw = buf.get_u16_le();
27976 __struct.servo16_raw = buf.get_u16_le();
27977 Ok(__struct)
27978 }
27979 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27980 let mut __tmp = BytesMut::new(bytes);
27981 #[allow(clippy::absurd_extreme_comparisons)]
27982 #[allow(unused_comparisons)]
27983 if __tmp.remaining() < Self::ENCODED_LEN {
27984 panic!(
27985 "buffer is too small (need {} bytes, but got {})",
27986 Self::ENCODED_LEN,
27987 __tmp.remaining(),
27988 )
27989 }
27990 __tmp.put_u32_le(self.time_usec);
27991 __tmp.put_u16_le(self.servo1_raw);
27992 __tmp.put_u16_le(self.servo2_raw);
27993 __tmp.put_u16_le(self.servo3_raw);
27994 __tmp.put_u16_le(self.servo4_raw);
27995 __tmp.put_u16_le(self.servo5_raw);
27996 __tmp.put_u16_le(self.servo6_raw);
27997 __tmp.put_u16_le(self.servo7_raw);
27998 __tmp.put_u16_le(self.servo8_raw);
27999 __tmp.put_u8(self.port);
28000 if matches!(version, MavlinkVersion::V2) {
28001 __tmp.put_u16_le(self.servo9_raw);
28002 __tmp.put_u16_le(self.servo10_raw);
28003 __tmp.put_u16_le(self.servo11_raw);
28004 __tmp.put_u16_le(self.servo12_raw);
28005 __tmp.put_u16_le(self.servo13_raw);
28006 __tmp.put_u16_le(self.servo14_raw);
28007 __tmp.put_u16_le(self.servo15_raw);
28008 __tmp.put_u16_le(self.servo16_raw);
28009 let len = __tmp.len();
28010 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28011 } else {
28012 __tmp.len()
28013 }
28014 }
28015}
28016#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
28017#[doc = ""]
28018#[doc = "ID: 256"]
28019#[derive(Debug, Clone, PartialEq)]
28020#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28021#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28022#[cfg_attr(feature = "ts", derive(TS))]
28023#[cfg_attr(feature = "ts", ts(export))]
28024pub struct SETUP_SIGNING_DATA {
28025 #[doc = "initial timestamp"]
28026 pub initial_timestamp: u64,
28027 #[doc = "system id of the target"]
28028 pub target_system: u8,
28029 #[doc = "component ID of the target"]
28030 pub target_component: u8,
28031 #[doc = "signing key"]
28032 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28033 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28034 pub secret_key: [u8; 32],
28035}
28036impl SETUP_SIGNING_DATA {
28037 pub const ENCODED_LEN: usize = 42usize;
28038 pub const DEFAULT: Self = Self {
28039 initial_timestamp: 0_u64,
28040 target_system: 0_u8,
28041 target_component: 0_u8,
28042 secret_key: [0_u8; 32usize],
28043 };
28044 #[cfg(feature = "arbitrary")]
28045 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28046 use arbitrary::{Arbitrary, Unstructured};
28047 let mut buf = [0u8; 1024];
28048 rng.fill_bytes(&mut buf);
28049 let mut unstructured = Unstructured::new(&buf);
28050 Self::arbitrary(&mut unstructured).unwrap_or_default()
28051 }
28052}
28053impl Default for SETUP_SIGNING_DATA {
28054 fn default() -> Self {
28055 Self::DEFAULT.clone()
28056 }
28057}
28058impl MessageData for SETUP_SIGNING_DATA {
28059 type Message = MavMessage;
28060 const ID: u32 = 256u32;
28061 const NAME: &'static str = "SETUP_SIGNING";
28062 const EXTRA_CRC: u8 = 71u8;
28063 const ENCODED_LEN: usize = 42usize;
28064 fn deser(
28065 _version: MavlinkVersion,
28066 __input: &[u8],
28067 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28068 let avail_len = __input.len();
28069 let mut payload_buf = [0; Self::ENCODED_LEN];
28070 let mut buf = if avail_len < Self::ENCODED_LEN {
28071 payload_buf[0..avail_len].copy_from_slice(__input);
28072 Bytes::new(&payload_buf)
28073 } else {
28074 Bytes::new(__input)
28075 };
28076 let mut __struct = Self::default();
28077 __struct.initial_timestamp = buf.get_u64_le();
28078 __struct.target_system = buf.get_u8();
28079 __struct.target_component = buf.get_u8();
28080 for v in &mut __struct.secret_key {
28081 let val = buf.get_u8();
28082 *v = val;
28083 }
28084 Ok(__struct)
28085 }
28086 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28087 let mut __tmp = BytesMut::new(bytes);
28088 #[allow(clippy::absurd_extreme_comparisons)]
28089 #[allow(unused_comparisons)]
28090 if __tmp.remaining() < Self::ENCODED_LEN {
28091 panic!(
28092 "buffer is too small (need {} bytes, but got {})",
28093 Self::ENCODED_LEN,
28094 __tmp.remaining(),
28095 )
28096 }
28097 __tmp.put_u64_le(self.initial_timestamp);
28098 __tmp.put_u8(self.target_system);
28099 __tmp.put_u8(self.target_component);
28100 for val in &self.secret_key {
28101 __tmp.put_u8(*val);
28102 }
28103 if matches!(version, MavlinkVersion::V2) {
28104 let len = __tmp.len();
28105 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28106 } else {
28107 __tmp.len()
28108 }
28109 }
28110}
28111#[doc = "Set the vehicle attitude and body angular rates."]
28112#[doc = ""]
28113#[doc = "ID: 139"]
28114#[derive(Debug, Clone, PartialEq)]
28115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28117#[cfg_attr(feature = "ts", derive(TS))]
28118#[cfg_attr(feature = "ts", ts(export))]
28119pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
28120 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28121 pub time_usec: u64,
28122 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
28123 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28124 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28125 pub controls: [f32; 8],
28126 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
28127 pub group_mlx: u8,
28128 #[doc = "System ID"]
28129 pub target_system: u8,
28130 #[doc = "Component ID"]
28131 pub target_component: u8,
28132}
28133impl SET_ACTUATOR_CONTROL_TARGET_DATA {
28134 pub const ENCODED_LEN: usize = 43usize;
28135 pub const DEFAULT: Self = Self {
28136 time_usec: 0_u64,
28137 controls: [0.0_f32; 8usize],
28138 group_mlx: 0_u8,
28139 target_system: 0_u8,
28140 target_component: 0_u8,
28141 };
28142 #[cfg(feature = "arbitrary")]
28143 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28144 use arbitrary::{Arbitrary, Unstructured};
28145 let mut buf = [0u8; 1024];
28146 rng.fill_bytes(&mut buf);
28147 let mut unstructured = Unstructured::new(&buf);
28148 Self::arbitrary(&mut unstructured).unwrap_or_default()
28149 }
28150}
28151impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
28152 fn default() -> Self {
28153 Self::DEFAULT.clone()
28154 }
28155}
28156impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
28157 type Message = MavMessage;
28158 const ID: u32 = 139u32;
28159 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
28160 const EXTRA_CRC: u8 = 168u8;
28161 const ENCODED_LEN: usize = 43usize;
28162 fn deser(
28163 _version: MavlinkVersion,
28164 __input: &[u8],
28165 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28166 let avail_len = __input.len();
28167 let mut payload_buf = [0; Self::ENCODED_LEN];
28168 let mut buf = if avail_len < Self::ENCODED_LEN {
28169 payload_buf[0..avail_len].copy_from_slice(__input);
28170 Bytes::new(&payload_buf)
28171 } else {
28172 Bytes::new(__input)
28173 };
28174 let mut __struct = Self::default();
28175 __struct.time_usec = buf.get_u64_le();
28176 for v in &mut __struct.controls {
28177 let val = buf.get_f32_le();
28178 *v = val;
28179 }
28180 __struct.group_mlx = buf.get_u8();
28181 __struct.target_system = buf.get_u8();
28182 __struct.target_component = buf.get_u8();
28183 Ok(__struct)
28184 }
28185 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28186 let mut __tmp = BytesMut::new(bytes);
28187 #[allow(clippy::absurd_extreme_comparisons)]
28188 #[allow(unused_comparisons)]
28189 if __tmp.remaining() < Self::ENCODED_LEN {
28190 panic!(
28191 "buffer is too small (need {} bytes, but got {})",
28192 Self::ENCODED_LEN,
28193 __tmp.remaining(),
28194 )
28195 }
28196 __tmp.put_u64_le(self.time_usec);
28197 for val in &self.controls {
28198 __tmp.put_f32_le(*val);
28199 }
28200 __tmp.put_u8(self.group_mlx);
28201 __tmp.put_u8(self.target_system);
28202 __tmp.put_u8(self.target_component);
28203 if matches!(version, MavlinkVersion::V2) {
28204 let len = __tmp.len();
28205 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28206 } else {
28207 __tmp.len()
28208 }
28209 }
28210}
28211#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
28212#[doc = ""]
28213#[doc = "ID: 82"]
28214#[derive(Debug, Clone, PartialEq)]
28215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28216#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28217#[cfg_attr(feature = "ts", derive(TS))]
28218#[cfg_attr(feature = "ts", ts(export))]
28219pub struct SET_ATTITUDE_TARGET_DATA {
28220 #[doc = "Timestamp (time since system boot)."]
28221 pub time_boot_ms: u32,
28222 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
28223 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28224 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28225 pub q: [f32; 4],
28226 #[doc = "Body roll rate"]
28227 pub body_roll_rate: f32,
28228 #[doc = "Body pitch rate"]
28229 pub body_pitch_rate: f32,
28230 #[doc = "Body yaw rate"]
28231 pub body_yaw_rate: f32,
28232 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
28233 pub thrust: f32,
28234 #[doc = "System ID"]
28235 pub target_system: u8,
28236 #[doc = "Component ID"]
28237 pub target_component: u8,
28238 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28239 pub type_mask: AttitudeTargetTypemask,
28240 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
28241 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28242 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28243 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28244 pub thrust_body: [f32; 3],
28245}
28246impl SET_ATTITUDE_TARGET_DATA {
28247 pub const ENCODED_LEN: usize = 51usize;
28248 pub const DEFAULT: Self = Self {
28249 time_boot_ms: 0_u32,
28250 q: [0.0_f32; 4usize],
28251 body_roll_rate: 0.0_f32,
28252 body_pitch_rate: 0.0_f32,
28253 body_yaw_rate: 0.0_f32,
28254 thrust: 0.0_f32,
28255 target_system: 0_u8,
28256 target_component: 0_u8,
28257 type_mask: AttitudeTargetTypemask::DEFAULT,
28258 thrust_body: [0.0_f32; 3usize],
28259 };
28260 #[cfg(feature = "arbitrary")]
28261 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28262 use arbitrary::{Arbitrary, Unstructured};
28263 let mut buf = [0u8; 1024];
28264 rng.fill_bytes(&mut buf);
28265 let mut unstructured = Unstructured::new(&buf);
28266 Self::arbitrary(&mut unstructured).unwrap_or_default()
28267 }
28268}
28269impl Default for SET_ATTITUDE_TARGET_DATA {
28270 fn default() -> Self {
28271 Self::DEFAULT.clone()
28272 }
28273}
28274impl MessageData for SET_ATTITUDE_TARGET_DATA {
28275 type Message = MavMessage;
28276 const ID: u32 = 82u32;
28277 const NAME: &'static str = "SET_ATTITUDE_TARGET";
28278 const EXTRA_CRC: u8 = 49u8;
28279 const ENCODED_LEN: usize = 51usize;
28280 fn deser(
28281 _version: MavlinkVersion,
28282 __input: &[u8],
28283 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28284 let avail_len = __input.len();
28285 let mut payload_buf = [0; Self::ENCODED_LEN];
28286 let mut buf = if avail_len < Self::ENCODED_LEN {
28287 payload_buf[0..avail_len].copy_from_slice(__input);
28288 Bytes::new(&payload_buf)
28289 } else {
28290 Bytes::new(__input)
28291 };
28292 let mut __struct = Self::default();
28293 __struct.time_boot_ms = buf.get_u32_le();
28294 for v in &mut __struct.q {
28295 let val = buf.get_f32_le();
28296 *v = val;
28297 }
28298 __struct.body_roll_rate = buf.get_f32_le();
28299 __struct.body_pitch_rate = buf.get_f32_le();
28300 __struct.body_yaw_rate = buf.get_f32_le();
28301 __struct.thrust = buf.get_f32_le();
28302 __struct.target_system = buf.get_u8();
28303 __struct.target_component = buf.get_u8();
28304 let tmp = buf.get_u8();
28305 __struct.type_mask = AttitudeTargetTypemask::from_bits(
28306 tmp & AttitudeTargetTypemask::all().bits(),
28307 )
28308 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28309 flag_type: "AttitudeTargetTypemask",
28310 value: tmp as u32,
28311 })?;
28312 for v in &mut __struct.thrust_body {
28313 let val = buf.get_f32_le();
28314 *v = val;
28315 }
28316 Ok(__struct)
28317 }
28318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28319 let mut __tmp = BytesMut::new(bytes);
28320 #[allow(clippy::absurd_extreme_comparisons)]
28321 #[allow(unused_comparisons)]
28322 if __tmp.remaining() < Self::ENCODED_LEN {
28323 panic!(
28324 "buffer is too small (need {} bytes, but got {})",
28325 Self::ENCODED_LEN,
28326 __tmp.remaining(),
28327 )
28328 }
28329 __tmp.put_u32_le(self.time_boot_ms);
28330 for val in &self.q {
28331 __tmp.put_f32_le(*val);
28332 }
28333 __tmp.put_f32_le(self.body_roll_rate);
28334 __tmp.put_f32_le(self.body_pitch_rate);
28335 __tmp.put_f32_le(self.body_yaw_rate);
28336 __tmp.put_f32_le(self.thrust);
28337 __tmp.put_u8(self.target_system);
28338 __tmp.put_u8(self.target_component);
28339 __tmp.put_u8(self.type_mask.bits());
28340 if matches!(version, MavlinkVersion::V2) {
28341 for val in &self.thrust_body {
28342 __tmp.put_f32_le(*val);
28343 }
28344 let len = __tmp.len();
28345 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28346 } else {
28347 __tmp.len()
28348 }
28349 }
28350}
28351#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
28352#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
28353#[doc = ""]
28354#[doc = "ID: 48"]
28355#[derive(Debug, Clone, PartialEq)]
28356#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28357#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28358#[cfg_attr(feature = "ts", derive(TS))]
28359#[cfg_attr(feature = "ts", ts(export))]
28360pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
28361 #[doc = "Latitude (WGS84)"]
28362 pub latitude: i32,
28363 #[doc = "Longitude (WGS84)"]
28364 pub longitude: i32,
28365 #[doc = "Altitude (MSL). Positive for up."]
28366 pub altitude: i32,
28367 #[doc = "System ID"]
28368 pub target_system: u8,
28369 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28370 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28371 pub time_usec: u64,
28372}
28373impl SET_GPS_GLOBAL_ORIGIN_DATA {
28374 pub const ENCODED_LEN: usize = 21usize;
28375 pub const DEFAULT: Self = Self {
28376 latitude: 0_i32,
28377 longitude: 0_i32,
28378 altitude: 0_i32,
28379 target_system: 0_u8,
28380 time_usec: 0_u64,
28381 };
28382 #[cfg(feature = "arbitrary")]
28383 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28384 use arbitrary::{Arbitrary, Unstructured};
28385 let mut buf = [0u8; 1024];
28386 rng.fill_bytes(&mut buf);
28387 let mut unstructured = Unstructured::new(&buf);
28388 Self::arbitrary(&mut unstructured).unwrap_or_default()
28389 }
28390}
28391impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28392 fn default() -> Self {
28393 Self::DEFAULT.clone()
28394 }
28395}
28396impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28397 type Message = MavMessage;
28398 const ID: u32 = 48u32;
28399 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28400 const EXTRA_CRC: u8 = 41u8;
28401 const ENCODED_LEN: usize = 21usize;
28402 fn deser(
28403 _version: MavlinkVersion,
28404 __input: &[u8],
28405 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28406 let avail_len = __input.len();
28407 let mut payload_buf = [0; Self::ENCODED_LEN];
28408 let mut buf = if avail_len < Self::ENCODED_LEN {
28409 payload_buf[0..avail_len].copy_from_slice(__input);
28410 Bytes::new(&payload_buf)
28411 } else {
28412 Bytes::new(__input)
28413 };
28414 let mut __struct = Self::default();
28415 __struct.latitude = buf.get_i32_le();
28416 __struct.longitude = buf.get_i32_le();
28417 __struct.altitude = buf.get_i32_le();
28418 __struct.target_system = buf.get_u8();
28419 __struct.time_usec = buf.get_u64_le();
28420 Ok(__struct)
28421 }
28422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28423 let mut __tmp = BytesMut::new(bytes);
28424 #[allow(clippy::absurd_extreme_comparisons)]
28425 #[allow(unused_comparisons)]
28426 if __tmp.remaining() < Self::ENCODED_LEN {
28427 panic!(
28428 "buffer is too small (need {} bytes, but got {})",
28429 Self::ENCODED_LEN,
28430 __tmp.remaining(),
28431 )
28432 }
28433 __tmp.put_i32_le(self.latitude);
28434 __tmp.put_i32_le(self.longitude);
28435 __tmp.put_i32_le(self.altitude);
28436 __tmp.put_u8(self.target_system);
28437 if matches!(version, MavlinkVersion::V2) {
28438 __tmp.put_u64_le(self.time_usec);
28439 let len = __tmp.len();
28440 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28441 } else {
28442 __tmp.len()
28443 }
28444 }
28445}
28446#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28447#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28448#[doc = ""]
28449#[doc = "ID: 243"]
28450#[derive(Debug, Clone, PartialEq)]
28451#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28453#[cfg_attr(feature = "ts", derive(TS))]
28454#[cfg_attr(feature = "ts", ts(export))]
28455pub struct SET_HOME_POSITION_DATA {
28456 #[doc = "Latitude (WGS84)"]
28457 pub latitude: i32,
28458 #[doc = "Longitude (WGS84)"]
28459 pub longitude: i32,
28460 #[doc = "Altitude (MSL). Positive for up."]
28461 pub altitude: i32,
28462 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28463 pub x: f32,
28464 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28465 pub y: f32,
28466 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28467 pub z: f32,
28468 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28469 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28470 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28471 pub q: [f32; 4],
28472 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28473 pub approach_x: f32,
28474 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28475 pub approach_y: f32,
28476 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28477 pub approach_z: f32,
28478 #[doc = "System ID."]
28479 pub target_system: u8,
28480 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28481 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28482 pub time_usec: u64,
28483}
28484impl SET_HOME_POSITION_DATA {
28485 pub const ENCODED_LEN: usize = 61usize;
28486 pub const DEFAULT: Self = Self {
28487 latitude: 0_i32,
28488 longitude: 0_i32,
28489 altitude: 0_i32,
28490 x: 0.0_f32,
28491 y: 0.0_f32,
28492 z: 0.0_f32,
28493 q: [0.0_f32; 4usize],
28494 approach_x: 0.0_f32,
28495 approach_y: 0.0_f32,
28496 approach_z: 0.0_f32,
28497 target_system: 0_u8,
28498 time_usec: 0_u64,
28499 };
28500 #[cfg(feature = "arbitrary")]
28501 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28502 use arbitrary::{Arbitrary, Unstructured};
28503 let mut buf = [0u8; 1024];
28504 rng.fill_bytes(&mut buf);
28505 let mut unstructured = Unstructured::new(&buf);
28506 Self::arbitrary(&mut unstructured).unwrap_or_default()
28507 }
28508}
28509impl Default for SET_HOME_POSITION_DATA {
28510 fn default() -> Self {
28511 Self::DEFAULT.clone()
28512 }
28513}
28514impl MessageData for SET_HOME_POSITION_DATA {
28515 type Message = MavMessage;
28516 const ID: u32 = 243u32;
28517 const NAME: &'static str = "SET_HOME_POSITION";
28518 const EXTRA_CRC: u8 = 85u8;
28519 const ENCODED_LEN: usize = 61usize;
28520 fn deser(
28521 _version: MavlinkVersion,
28522 __input: &[u8],
28523 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28524 let avail_len = __input.len();
28525 let mut payload_buf = [0; Self::ENCODED_LEN];
28526 let mut buf = if avail_len < Self::ENCODED_LEN {
28527 payload_buf[0..avail_len].copy_from_slice(__input);
28528 Bytes::new(&payload_buf)
28529 } else {
28530 Bytes::new(__input)
28531 };
28532 let mut __struct = Self::default();
28533 __struct.latitude = buf.get_i32_le();
28534 __struct.longitude = buf.get_i32_le();
28535 __struct.altitude = buf.get_i32_le();
28536 __struct.x = buf.get_f32_le();
28537 __struct.y = buf.get_f32_le();
28538 __struct.z = buf.get_f32_le();
28539 for v in &mut __struct.q {
28540 let val = buf.get_f32_le();
28541 *v = val;
28542 }
28543 __struct.approach_x = buf.get_f32_le();
28544 __struct.approach_y = buf.get_f32_le();
28545 __struct.approach_z = buf.get_f32_le();
28546 __struct.target_system = buf.get_u8();
28547 __struct.time_usec = buf.get_u64_le();
28548 Ok(__struct)
28549 }
28550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28551 let mut __tmp = BytesMut::new(bytes);
28552 #[allow(clippy::absurd_extreme_comparisons)]
28553 #[allow(unused_comparisons)]
28554 if __tmp.remaining() < Self::ENCODED_LEN {
28555 panic!(
28556 "buffer is too small (need {} bytes, but got {})",
28557 Self::ENCODED_LEN,
28558 __tmp.remaining(),
28559 )
28560 }
28561 __tmp.put_i32_le(self.latitude);
28562 __tmp.put_i32_le(self.longitude);
28563 __tmp.put_i32_le(self.altitude);
28564 __tmp.put_f32_le(self.x);
28565 __tmp.put_f32_le(self.y);
28566 __tmp.put_f32_le(self.z);
28567 for val in &self.q {
28568 __tmp.put_f32_le(*val);
28569 }
28570 __tmp.put_f32_le(self.approach_x);
28571 __tmp.put_f32_le(self.approach_y);
28572 __tmp.put_f32_le(self.approach_z);
28573 __tmp.put_u8(self.target_system);
28574 if matches!(version, MavlinkVersion::V2) {
28575 __tmp.put_u64_le(self.time_usec);
28576 let len = __tmp.len();
28577 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28578 } else {
28579 __tmp.len()
28580 }
28581 }
28582}
28583#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28584#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28585#[doc = ""]
28586#[doc = "ID: 11"]
28587#[derive(Debug, Clone, PartialEq)]
28588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28590#[cfg_attr(feature = "ts", derive(TS))]
28591#[cfg_attr(feature = "ts", ts(export))]
28592pub struct SET_MODE_DATA {
28593 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28594 pub custom_mode: u32,
28595 #[doc = "The system setting the mode"]
28596 pub target_system: u8,
28597 #[doc = "The new base mode."]
28598 pub base_mode: MavMode,
28599}
28600impl SET_MODE_DATA {
28601 pub const ENCODED_LEN: usize = 6usize;
28602 pub const DEFAULT: Self = Self {
28603 custom_mode: 0_u32,
28604 target_system: 0_u8,
28605 base_mode: MavMode::DEFAULT,
28606 };
28607 #[cfg(feature = "arbitrary")]
28608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28609 use arbitrary::{Arbitrary, Unstructured};
28610 let mut buf = [0u8; 1024];
28611 rng.fill_bytes(&mut buf);
28612 let mut unstructured = Unstructured::new(&buf);
28613 Self::arbitrary(&mut unstructured).unwrap_or_default()
28614 }
28615}
28616impl Default for SET_MODE_DATA {
28617 fn default() -> Self {
28618 Self::DEFAULT.clone()
28619 }
28620}
28621impl MessageData for SET_MODE_DATA {
28622 type Message = MavMessage;
28623 const ID: u32 = 11u32;
28624 const NAME: &'static str = "SET_MODE";
28625 const EXTRA_CRC: u8 = 89u8;
28626 const ENCODED_LEN: usize = 6usize;
28627 fn deser(
28628 _version: MavlinkVersion,
28629 __input: &[u8],
28630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28631 let avail_len = __input.len();
28632 let mut payload_buf = [0; Self::ENCODED_LEN];
28633 let mut buf = if avail_len < Self::ENCODED_LEN {
28634 payload_buf[0..avail_len].copy_from_slice(__input);
28635 Bytes::new(&payload_buf)
28636 } else {
28637 Bytes::new(__input)
28638 };
28639 let mut __struct = Self::default();
28640 __struct.custom_mode = buf.get_u32_le();
28641 __struct.target_system = buf.get_u8();
28642 let tmp = buf.get_u8();
28643 __struct.base_mode =
28644 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28645 enum_type: "MavMode",
28646 value: tmp as u32,
28647 })?;
28648 Ok(__struct)
28649 }
28650 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28651 let mut __tmp = BytesMut::new(bytes);
28652 #[allow(clippy::absurd_extreme_comparisons)]
28653 #[allow(unused_comparisons)]
28654 if __tmp.remaining() < Self::ENCODED_LEN {
28655 panic!(
28656 "buffer is too small (need {} bytes, but got {})",
28657 Self::ENCODED_LEN,
28658 __tmp.remaining(),
28659 )
28660 }
28661 __tmp.put_u32_le(self.custom_mode);
28662 __tmp.put_u8(self.target_system);
28663 __tmp.put_u8(self.base_mode as u8);
28664 if matches!(version, MavlinkVersion::V2) {
28665 let len = __tmp.len();
28666 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28667 } else {
28668 __tmp.len()
28669 }
28670 }
28671}
28672#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28673#[doc = ""]
28674#[doc = "ID: 86"]
28675#[derive(Debug, Clone, PartialEq)]
28676#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28677#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28678#[cfg_attr(feature = "ts", derive(TS))]
28679#[cfg_attr(feature = "ts", ts(export))]
28680pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28681 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28682 pub time_boot_ms: u32,
28683 #[doc = "Latitude in WGS84 frame"]
28684 pub lat_int: i32,
28685 #[doc = "Longitude in WGS84 frame"]
28686 pub lon_int: i32,
28687 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28688 pub alt: f32,
28689 #[doc = "X velocity in NED frame"]
28690 pub vx: f32,
28691 #[doc = "Y velocity in NED frame"]
28692 pub vy: f32,
28693 #[doc = "Z velocity in NED frame"]
28694 pub vz: f32,
28695 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28696 pub afx: f32,
28697 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28698 pub afy: f32,
28699 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28700 pub afz: f32,
28701 #[doc = "yaw setpoint"]
28702 pub yaw: f32,
28703 #[doc = "yaw rate setpoint"]
28704 pub yaw_rate: f32,
28705 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28706 pub type_mask: PositionTargetTypemask,
28707 #[doc = "System ID"]
28708 pub target_system: u8,
28709 #[doc = "Component ID"]
28710 pub target_component: u8,
28711 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28712 pub coordinate_frame: MavFrame,
28713}
28714impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28715 pub const ENCODED_LEN: usize = 53usize;
28716 pub const DEFAULT: Self = Self {
28717 time_boot_ms: 0_u32,
28718 lat_int: 0_i32,
28719 lon_int: 0_i32,
28720 alt: 0.0_f32,
28721 vx: 0.0_f32,
28722 vy: 0.0_f32,
28723 vz: 0.0_f32,
28724 afx: 0.0_f32,
28725 afy: 0.0_f32,
28726 afz: 0.0_f32,
28727 yaw: 0.0_f32,
28728 yaw_rate: 0.0_f32,
28729 type_mask: PositionTargetTypemask::DEFAULT,
28730 target_system: 0_u8,
28731 target_component: 0_u8,
28732 coordinate_frame: MavFrame::DEFAULT,
28733 };
28734 #[cfg(feature = "arbitrary")]
28735 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28736 use arbitrary::{Arbitrary, Unstructured};
28737 let mut buf = [0u8; 1024];
28738 rng.fill_bytes(&mut buf);
28739 let mut unstructured = Unstructured::new(&buf);
28740 Self::arbitrary(&mut unstructured).unwrap_or_default()
28741 }
28742}
28743impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28744 fn default() -> Self {
28745 Self::DEFAULT.clone()
28746 }
28747}
28748impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28749 type Message = MavMessage;
28750 const ID: u32 = 86u32;
28751 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28752 const EXTRA_CRC: u8 = 5u8;
28753 const ENCODED_LEN: usize = 53usize;
28754 fn deser(
28755 _version: MavlinkVersion,
28756 __input: &[u8],
28757 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28758 let avail_len = __input.len();
28759 let mut payload_buf = [0; Self::ENCODED_LEN];
28760 let mut buf = if avail_len < Self::ENCODED_LEN {
28761 payload_buf[0..avail_len].copy_from_slice(__input);
28762 Bytes::new(&payload_buf)
28763 } else {
28764 Bytes::new(__input)
28765 };
28766 let mut __struct = Self::default();
28767 __struct.time_boot_ms = buf.get_u32_le();
28768 __struct.lat_int = buf.get_i32_le();
28769 __struct.lon_int = buf.get_i32_le();
28770 __struct.alt = buf.get_f32_le();
28771 __struct.vx = buf.get_f32_le();
28772 __struct.vy = buf.get_f32_le();
28773 __struct.vz = buf.get_f32_le();
28774 __struct.afx = buf.get_f32_le();
28775 __struct.afy = buf.get_f32_le();
28776 __struct.afz = buf.get_f32_le();
28777 __struct.yaw = buf.get_f32_le();
28778 __struct.yaw_rate = buf.get_f32_le();
28779 let tmp = buf.get_u16_le();
28780 __struct.type_mask = PositionTargetTypemask::from_bits(
28781 tmp & PositionTargetTypemask::all().bits(),
28782 )
28783 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28784 flag_type: "PositionTargetTypemask",
28785 value: tmp as u32,
28786 })?;
28787 __struct.target_system = buf.get_u8();
28788 __struct.target_component = buf.get_u8();
28789 let tmp = buf.get_u8();
28790 __struct.coordinate_frame =
28791 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28792 enum_type: "MavFrame",
28793 value: tmp as u32,
28794 })?;
28795 Ok(__struct)
28796 }
28797 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28798 let mut __tmp = BytesMut::new(bytes);
28799 #[allow(clippy::absurd_extreme_comparisons)]
28800 #[allow(unused_comparisons)]
28801 if __tmp.remaining() < Self::ENCODED_LEN {
28802 panic!(
28803 "buffer is too small (need {} bytes, but got {})",
28804 Self::ENCODED_LEN,
28805 __tmp.remaining(),
28806 )
28807 }
28808 __tmp.put_u32_le(self.time_boot_ms);
28809 __tmp.put_i32_le(self.lat_int);
28810 __tmp.put_i32_le(self.lon_int);
28811 __tmp.put_f32_le(self.alt);
28812 __tmp.put_f32_le(self.vx);
28813 __tmp.put_f32_le(self.vy);
28814 __tmp.put_f32_le(self.vz);
28815 __tmp.put_f32_le(self.afx);
28816 __tmp.put_f32_le(self.afy);
28817 __tmp.put_f32_le(self.afz);
28818 __tmp.put_f32_le(self.yaw);
28819 __tmp.put_f32_le(self.yaw_rate);
28820 __tmp.put_u16_le(self.type_mask.bits());
28821 __tmp.put_u8(self.target_system);
28822 __tmp.put_u8(self.target_component);
28823 __tmp.put_u8(self.coordinate_frame as u8);
28824 if matches!(version, MavlinkVersion::V2) {
28825 let len = __tmp.len();
28826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28827 } else {
28828 __tmp.len()
28829 }
28830 }
28831}
28832#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28833#[doc = ""]
28834#[doc = "ID: 84"]
28835#[derive(Debug, Clone, PartialEq)]
28836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28837#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28838#[cfg_attr(feature = "ts", derive(TS))]
28839#[cfg_attr(feature = "ts", ts(export))]
28840pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28841 #[doc = "Timestamp (time since system boot)."]
28842 pub time_boot_ms: u32,
28843 #[doc = "X Position in NED frame"]
28844 pub x: f32,
28845 #[doc = "Y Position in NED frame"]
28846 pub y: f32,
28847 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28848 pub z: f32,
28849 #[doc = "X velocity in NED frame"]
28850 pub vx: f32,
28851 #[doc = "Y velocity in NED frame"]
28852 pub vy: f32,
28853 #[doc = "Z velocity in NED frame"]
28854 pub vz: f32,
28855 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28856 pub afx: f32,
28857 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28858 pub afy: f32,
28859 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28860 pub afz: f32,
28861 #[doc = "yaw setpoint"]
28862 pub yaw: f32,
28863 #[doc = "yaw rate setpoint"]
28864 pub yaw_rate: f32,
28865 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28866 pub type_mask: PositionTargetTypemask,
28867 #[doc = "System ID"]
28868 pub target_system: u8,
28869 #[doc = "Component ID"]
28870 pub target_component: u8,
28871 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28872 pub coordinate_frame: MavFrame,
28873}
28874impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28875 pub const ENCODED_LEN: usize = 53usize;
28876 pub const DEFAULT: Self = Self {
28877 time_boot_ms: 0_u32,
28878 x: 0.0_f32,
28879 y: 0.0_f32,
28880 z: 0.0_f32,
28881 vx: 0.0_f32,
28882 vy: 0.0_f32,
28883 vz: 0.0_f32,
28884 afx: 0.0_f32,
28885 afy: 0.0_f32,
28886 afz: 0.0_f32,
28887 yaw: 0.0_f32,
28888 yaw_rate: 0.0_f32,
28889 type_mask: PositionTargetTypemask::DEFAULT,
28890 target_system: 0_u8,
28891 target_component: 0_u8,
28892 coordinate_frame: MavFrame::DEFAULT,
28893 };
28894 #[cfg(feature = "arbitrary")]
28895 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28896 use arbitrary::{Arbitrary, Unstructured};
28897 let mut buf = [0u8; 1024];
28898 rng.fill_bytes(&mut buf);
28899 let mut unstructured = Unstructured::new(&buf);
28900 Self::arbitrary(&mut unstructured).unwrap_or_default()
28901 }
28902}
28903impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28904 fn default() -> Self {
28905 Self::DEFAULT.clone()
28906 }
28907}
28908impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28909 type Message = MavMessage;
28910 const ID: u32 = 84u32;
28911 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28912 const EXTRA_CRC: u8 = 143u8;
28913 const ENCODED_LEN: usize = 53usize;
28914 fn deser(
28915 _version: MavlinkVersion,
28916 __input: &[u8],
28917 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28918 let avail_len = __input.len();
28919 let mut payload_buf = [0; Self::ENCODED_LEN];
28920 let mut buf = if avail_len < Self::ENCODED_LEN {
28921 payload_buf[0..avail_len].copy_from_slice(__input);
28922 Bytes::new(&payload_buf)
28923 } else {
28924 Bytes::new(__input)
28925 };
28926 let mut __struct = Self::default();
28927 __struct.time_boot_ms = buf.get_u32_le();
28928 __struct.x = buf.get_f32_le();
28929 __struct.y = buf.get_f32_le();
28930 __struct.z = buf.get_f32_le();
28931 __struct.vx = buf.get_f32_le();
28932 __struct.vy = buf.get_f32_le();
28933 __struct.vz = buf.get_f32_le();
28934 __struct.afx = buf.get_f32_le();
28935 __struct.afy = buf.get_f32_le();
28936 __struct.afz = buf.get_f32_le();
28937 __struct.yaw = buf.get_f32_le();
28938 __struct.yaw_rate = buf.get_f32_le();
28939 let tmp = buf.get_u16_le();
28940 __struct.type_mask = PositionTargetTypemask::from_bits(
28941 tmp & PositionTargetTypemask::all().bits(),
28942 )
28943 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28944 flag_type: "PositionTargetTypemask",
28945 value: tmp as u32,
28946 })?;
28947 __struct.target_system = buf.get_u8();
28948 __struct.target_component = buf.get_u8();
28949 let tmp = buf.get_u8();
28950 __struct.coordinate_frame =
28951 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28952 enum_type: "MavFrame",
28953 value: tmp as u32,
28954 })?;
28955 Ok(__struct)
28956 }
28957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28958 let mut __tmp = BytesMut::new(bytes);
28959 #[allow(clippy::absurd_extreme_comparisons)]
28960 #[allow(unused_comparisons)]
28961 if __tmp.remaining() < Self::ENCODED_LEN {
28962 panic!(
28963 "buffer is too small (need {} bytes, but got {})",
28964 Self::ENCODED_LEN,
28965 __tmp.remaining(),
28966 )
28967 }
28968 __tmp.put_u32_le(self.time_boot_ms);
28969 __tmp.put_f32_le(self.x);
28970 __tmp.put_f32_le(self.y);
28971 __tmp.put_f32_le(self.z);
28972 __tmp.put_f32_le(self.vx);
28973 __tmp.put_f32_le(self.vy);
28974 __tmp.put_f32_le(self.vz);
28975 __tmp.put_f32_le(self.afx);
28976 __tmp.put_f32_le(self.afy);
28977 __tmp.put_f32_le(self.afz);
28978 __tmp.put_f32_le(self.yaw);
28979 __tmp.put_f32_le(self.yaw_rate);
28980 __tmp.put_u16_le(self.type_mask.bits());
28981 __tmp.put_u8(self.target_system);
28982 __tmp.put_u8(self.target_component);
28983 __tmp.put_u8(self.coordinate_frame as u8);
28984 if matches!(version, MavlinkVersion::V2) {
28985 let len = __tmp.len();
28986 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28987 } else {
28988 __tmp.len()
28989 }
28990 }
28991}
28992#[doc = "Status of simulation environment, if used."]
28993#[doc = ""]
28994#[doc = "ID: 108"]
28995#[derive(Debug, Clone, PartialEq)]
28996#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28997#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28998#[cfg_attr(feature = "ts", derive(TS))]
28999#[cfg_attr(feature = "ts", ts(export))]
29000pub struct SIM_STATE_DATA {
29001 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
29002 pub q1: f32,
29003 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
29004 pub q2: f32,
29005 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
29006 pub q3: f32,
29007 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
29008 pub q4: f32,
29009 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
29010 pub roll: f32,
29011 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
29012 pub pitch: f32,
29013 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
29014 pub yaw: f32,
29015 #[doc = "X acceleration"]
29016 pub xacc: f32,
29017 #[doc = "Y acceleration"]
29018 pub yacc: f32,
29019 #[doc = "Z acceleration"]
29020 pub zacc: f32,
29021 #[doc = "Angular speed around X axis"]
29022 pub xgyro: f32,
29023 #[doc = "Angular speed around Y axis"]
29024 pub ygyro: f32,
29025 #[doc = "Angular speed around Z axis"]
29026 pub zgyro: f32,
29027 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
29028 pub lat: f32,
29029 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
29030 pub lon: f32,
29031 #[doc = "Altitude"]
29032 pub alt: f32,
29033 #[doc = "Horizontal position standard deviation"]
29034 pub std_dev_horz: f32,
29035 #[doc = "Vertical position standard deviation"]
29036 pub std_dev_vert: f32,
29037 #[doc = "True velocity in north direction in earth-fixed NED frame"]
29038 pub vn: f32,
29039 #[doc = "True velocity in east direction in earth-fixed NED frame"]
29040 pub ve: f32,
29041 #[doc = "True velocity in down direction in earth-fixed NED frame"]
29042 pub vd: f32,
29043 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
29044 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29045 pub lat_int: i32,
29046 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
29047 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29048 pub lon_int: i32,
29049}
29050impl SIM_STATE_DATA {
29051 pub const ENCODED_LEN: usize = 92usize;
29052 pub const DEFAULT: Self = Self {
29053 q1: 0.0_f32,
29054 q2: 0.0_f32,
29055 q3: 0.0_f32,
29056 q4: 0.0_f32,
29057 roll: 0.0_f32,
29058 pitch: 0.0_f32,
29059 yaw: 0.0_f32,
29060 xacc: 0.0_f32,
29061 yacc: 0.0_f32,
29062 zacc: 0.0_f32,
29063 xgyro: 0.0_f32,
29064 ygyro: 0.0_f32,
29065 zgyro: 0.0_f32,
29066 lat: 0.0_f32,
29067 lon: 0.0_f32,
29068 alt: 0.0_f32,
29069 std_dev_horz: 0.0_f32,
29070 std_dev_vert: 0.0_f32,
29071 vn: 0.0_f32,
29072 ve: 0.0_f32,
29073 vd: 0.0_f32,
29074 lat_int: 0_i32,
29075 lon_int: 0_i32,
29076 };
29077 #[cfg(feature = "arbitrary")]
29078 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29079 use arbitrary::{Arbitrary, Unstructured};
29080 let mut buf = [0u8; 1024];
29081 rng.fill_bytes(&mut buf);
29082 let mut unstructured = Unstructured::new(&buf);
29083 Self::arbitrary(&mut unstructured).unwrap_or_default()
29084 }
29085}
29086impl Default for SIM_STATE_DATA {
29087 fn default() -> Self {
29088 Self::DEFAULT.clone()
29089 }
29090}
29091impl MessageData for SIM_STATE_DATA {
29092 type Message = MavMessage;
29093 const ID: u32 = 108u32;
29094 const NAME: &'static str = "SIM_STATE";
29095 const EXTRA_CRC: u8 = 32u8;
29096 const ENCODED_LEN: usize = 92usize;
29097 fn deser(
29098 _version: MavlinkVersion,
29099 __input: &[u8],
29100 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29101 let avail_len = __input.len();
29102 let mut payload_buf = [0; Self::ENCODED_LEN];
29103 let mut buf = if avail_len < Self::ENCODED_LEN {
29104 payload_buf[0..avail_len].copy_from_slice(__input);
29105 Bytes::new(&payload_buf)
29106 } else {
29107 Bytes::new(__input)
29108 };
29109 let mut __struct = Self::default();
29110 __struct.q1 = buf.get_f32_le();
29111 __struct.q2 = buf.get_f32_le();
29112 __struct.q3 = buf.get_f32_le();
29113 __struct.q4 = buf.get_f32_le();
29114 __struct.roll = buf.get_f32_le();
29115 __struct.pitch = buf.get_f32_le();
29116 __struct.yaw = buf.get_f32_le();
29117 __struct.xacc = buf.get_f32_le();
29118 __struct.yacc = buf.get_f32_le();
29119 __struct.zacc = buf.get_f32_le();
29120 __struct.xgyro = buf.get_f32_le();
29121 __struct.ygyro = buf.get_f32_le();
29122 __struct.zgyro = buf.get_f32_le();
29123 __struct.lat = buf.get_f32_le();
29124 __struct.lon = buf.get_f32_le();
29125 __struct.alt = buf.get_f32_le();
29126 __struct.std_dev_horz = buf.get_f32_le();
29127 __struct.std_dev_vert = buf.get_f32_le();
29128 __struct.vn = buf.get_f32_le();
29129 __struct.ve = buf.get_f32_le();
29130 __struct.vd = buf.get_f32_le();
29131 __struct.lat_int = buf.get_i32_le();
29132 __struct.lon_int = buf.get_i32_le();
29133 Ok(__struct)
29134 }
29135 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29136 let mut __tmp = BytesMut::new(bytes);
29137 #[allow(clippy::absurd_extreme_comparisons)]
29138 #[allow(unused_comparisons)]
29139 if __tmp.remaining() < Self::ENCODED_LEN {
29140 panic!(
29141 "buffer is too small (need {} bytes, but got {})",
29142 Self::ENCODED_LEN,
29143 __tmp.remaining(),
29144 )
29145 }
29146 __tmp.put_f32_le(self.q1);
29147 __tmp.put_f32_le(self.q2);
29148 __tmp.put_f32_le(self.q3);
29149 __tmp.put_f32_le(self.q4);
29150 __tmp.put_f32_le(self.roll);
29151 __tmp.put_f32_le(self.pitch);
29152 __tmp.put_f32_le(self.yaw);
29153 __tmp.put_f32_le(self.xacc);
29154 __tmp.put_f32_le(self.yacc);
29155 __tmp.put_f32_le(self.zacc);
29156 __tmp.put_f32_le(self.xgyro);
29157 __tmp.put_f32_le(self.ygyro);
29158 __tmp.put_f32_le(self.zgyro);
29159 __tmp.put_f32_le(self.lat);
29160 __tmp.put_f32_le(self.lon);
29161 __tmp.put_f32_le(self.alt);
29162 __tmp.put_f32_le(self.std_dev_horz);
29163 __tmp.put_f32_le(self.std_dev_vert);
29164 __tmp.put_f32_le(self.vn);
29165 __tmp.put_f32_le(self.ve);
29166 __tmp.put_f32_le(self.vd);
29167 if matches!(version, MavlinkVersion::V2) {
29168 __tmp.put_i32_le(self.lat_int);
29169 __tmp.put_i32_le(self.lon_int);
29170 let len = __tmp.len();
29171 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29172 } else {
29173 __tmp.len()
29174 }
29175 }
29176}
29177#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
29178#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
29179#[doc = ""]
29180#[doc = "ID: 370"]
29181#[derive(Debug, Clone, PartialEq)]
29182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29184#[cfg_attr(feature = "ts", derive(TS))]
29185#[cfg_attr(feature = "ts", ts(export))]
29186pub struct SMART_BATTERY_INFO_DATA {
29187 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
29188 pub capacity_full_specification: i32,
29189 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
29190 pub capacity_full: i32,
29191 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
29192 pub cycle_count: u16,
29193 #[doc = "Battery weight. 0: field not provided."]
29194 pub weight: u16,
29195 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
29196 pub discharge_minimum_voltage: u16,
29197 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
29198 pub charging_minimum_voltage: u16,
29199 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
29200 pub resting_minimum_voltage: u16,
29201 #[doc = "Battery ID"]
29202 pub id: u8,
29203 #[doc = "Function of the battery"]
29204 pub battery_function: MavBatteryFunction,
29205 #[doc = "Type (chemistry) of the battery"]
29206 pub mavtype: MavBatteryType,
29207 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
29208 #[cfg_attr(
29209 feature = "serde",
29210 serde(
29211 serialize_with = "crate::nulstr::serialize::<_, 16>",
29212 deserialize_with = "crate::nulstr::deserialize::<_, 16>"
29213 )
29214 )]
29215 #[cfg_attr(feature = "ts", ts(type = "string"))]
29216 pub serial_number: [u8; 16],
29217 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
29218 #[cfg_attr(
29219 feature = "serde",
29220 serde(
29221 serialize_with = "crate::nulstr::serialize::<_, 50>",
29222 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
29223 )
29224 )]
29225 #[cfg_attr(feature = "ts", ts(type = "string"))]
29226 pub device_name: [u8; 50],
29227 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
29228 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29229 pub charging_maximum_voltage: u16,
29230 #[doc = "Number of battery cells in series. 0: field not provided."]
29231 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29232 pub cells_in_series: u8,
29233 #[doc = "Maximum pack discharge current. 0: field not provided."]
29234 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29235 pub discharge_maximum_current: u32,
29236 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
29237 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29238 pub discharge_maximum_burst_current: u32,
29239 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
29240 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29241 #[cfg_attr(
29242 feature = "serde",
29243 serde(
29244 serialize_with = "crate::nulstr::serialize::<_, 11>",
29245 deserialize_with = "crate::nulstr::deserialize::<_, 11>"
29246 )
29247 )]
29248 #[cfg_attr(feature = "ts", ts(type = "string"))]
29249 pub manufacture_date: [u8; 11],
29250}
29251impl SMART_BATTERY_INFO_DATA {
29252 pub const ENCODED_LEN: usize = 109usize;
29253 pub const DEFAULT: Self = Self {
29254 capacity_full_specification: 0_i32,
29255 capacity_full: 0_i32,
29256 cycle_count: 0_u16,
29257 weight: 0_u16,
29258 discharge_minimum_voltage: 0_u16,
29259 charging_minimum_voltage: 0_u16,
29260 resting_minimum_voltage: 0_u16,
29261 id: 0_u8,
29262 battery_function: MavBatteryFunction::DEFAULT,
29263 mavtype: MavBatteryType::DEFAULT,
29264 serial_number: [0_u8; 16usize],
29265 device_name: [0_u8; 50usize],
29266 charging_maximum_voltage: 0_u16,
29267 cells_in_series: 0_u8,
29268 discharge_maximum_current: 0_u32,
29269 discharge_maximum_burst_current: 0_u32,
29270 manufacture_date: [0_u8; 11usize],
29271 };
29272 #[cfg(feature = "arbitrary")]
29273 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29274 use arbitrary::{Arbitrary, Unstructured};
29275 let mut buf = [0u8; 1024];
29276 rng.fill_bytes(&mut buf);
29277 let mut unstructured = Unstructured::new(&buf);
29278 Self::arbitrary(&mut unstructured).unwrap_or_default()
29279 }
29280}
29281impl Default for SMART_BATTERY_INFO_DATA {
29282 fn default() -> Self {
29283 Self::DEFAULT.clone()
29284 }
29285}
29286impl MessageData for SMART_BATTERY_INFO_DATA {
29287 type Message = MavMessage;
29288 const ID: u32 = 370u32;
29289 const NAME: &'static str = "SMART_BATTERY_INFO";
29290 const EXTRA_CRC: u8 = 75u8;
29291 const ENCODED_LEN: usize = 109usize;
29292 fn deser(
29293 _version: MavlinkVersion,
29294 __input: &[u8],
29295 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29296 let avail_len = __input.len();
29297 let mut payload_buf = [0; Self::ENCODED_LEN];
29298 let mut buf = if avail_len < Self::ENCODED_LEN {
29299 payload_buf[0..avail_len].copy_from_slice(__input);
29300 Bytes::new(&payload_buf)
29301 } else {
29302 Bytes::new(__input)
29303 };
29304 let mut __struct = Self::default();
29305 __struct.capacity_full_specification = buf.get_i32_le();
29306 __struct.capacity_full = buf.get_i32_le();
29307 __struct.cycle_count = buf.get_u16_le();
29308 __struct.weight = buf.get_u16_le();
29309 __struct.discharge_minimum_voltage = buf.get_u16_le();
29310 __struct.charging_minimum_voltage = buf.get_u16_le();
29311 __struct.resting_minimum_voltage = buf.get_u16_le();
29312 __struct.id = buf.get_u8();
29313 let tmp = buf.get_u8();
29314 __struct.battery_function =
29315 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29316 enum_type: "MavBatteryFunction",
29317 value: tmp as u32,
29318 })?;
29319 let tmp = buf.get_u8();
29320 __struct.mavtype =
29321 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29322 enum_type: "MavBatteryType",
29323 value: tmp as u32,
29324 })?;
29325 for v in &mut __struct.serial_number {
29326 let val = buf.get_u8();
29327 *v = val;
29328 }
29329 for v in &mut __struct.device_name {
29330 let val = buf.get_u8();
29331 *v = val;
29332 }
29333 __struct.charging_maximum_voltage = buf.get_u16_le();
29334 __struct.cells_in_series = buf.get_u8();
29335 __struct.discharge_maximum_current = buf.get_u32_le();
29336 __struct.discharge_maximum_burst_current = buf.get_u32_le();
29337 for v in &mut __struct.manufacture_date {
29338 let val = buf.get_u8();
29339 *v = val;
29340 }
29341 Ok(__struct)
29342 }
29343 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29344 let mut __tmp = BytesMut::new(bytes);
29345 #[allow(clippy::absurd_extreme_comparisons)]
29346 #[allow(unused_comparisons)]
29347 if __tmp.remaining() < Self::ENCODED_LEN {
29348 panic!(
29349 "buffer is too small (need {} bytes, but got {})",
29350 Self::ENCODED_LEN,
29351 __tmp.remaining(),
29352 )
29353 }
29354 __tmp.put_i32_le(self.capacity_full_specification);
29355 __tmp.put_i32_le(self.capacity_full);
29356 __tmp.put_u16_le(self.cycle_count);
29357 __tmp.put_u16_le(self.weight);
29358 __tmp.put_u16_le(self.discharge_minimum_voltage);
29359 __tmp.put_u16_le(self.charging_minimum_voltage);
29360 __tmp.put_u16_le(self.resting_minimum_voltage);
29361 __tmp.put_u8(self.id);
29362 __tmp.put_u8(self.battery_function as u8);
29363 __tmp.put_u8(self.mavtype as u8);
29364 for val in &self.serial_number {
29365 __tmp.put_u8(*val);
29366 }
29367 for val in &self.device_name {
29368 __tmp.put_u8(*val);
29369 }
29370 if matches!(version, MavlinkVersion::V2) {
29371 __tmp.put_u16_le(self.charging_maximum_voltage);
29372 __tmp.put_u8(self.cells_in_series);
29373 __tmp.put_u32_le(self.discharge_maximum_current);
29374 __tmp.put_u32_le(self.discharge_maximum_burst_current);
29375 for val in &self.manufacture_date {
29376 __tmp.put_u8(*val);
29377 }
29378 let len = __tmp.len();
29379 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29380 } else {
29381 __tmp.len()
29382 }
29383 }
29384}
29385#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
29386#[doc = ""]
29387#[doc = "ID: 253"]
29388#[derive(Debug, Clone, PartialEq)]
29389#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29390#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29391#[cfg_attr(feature = "ts", derive(TS))]
29392#[cfg_attr(feature = "ts", ts(export))]
29393pub struct STATUSTEXT_DATA {
29394 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
29395 pub severity: MavSeverity,
29396 #[doc = "Status text message, without null termination character"]
29397 #[cfg_attr(
29398 feature = "serde",
29399 serde(
29400 serialize_with = "crate::nulstr::serialize::<_, 50>",
29401 deserialize_with = "crate::nulstr::deserialize::<_, 50>"
29402 )
29403 )]
29404 #[cfg_attr(feature = "ts", ts(type = "string"))]
29405 pub text: [u8; 50],
29406 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
29407 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29408 pub id: u16,
29409 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
29410 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29411 pub chunk_seq: u8,
29412}
29413impl STATUSTEXT_DATA {
29414 pub const ENCODED_LEN: usize = 54usize;
29415 pub const DEFAULT: Self = Self {
29416 severity: MavSeverity::DEFAULT,
29417 text: [0_u8; 50usize],
29418 id: 0_u16,
29419 chunk_seq: 0_u8,
29420 };
29421 #[cfg(feature = "arbitrary")]
29422 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29423 use arbitrary::{Arbitrary, Unstructured};
29424 let mut buf = [0u8; 1024];
29425 rng.fill_bytes(&mut buf);
29426 let mut unstructured = Unstructured::new(&buf);
29427 Self::arbitrary(&mut unstructured).unwrap_or_default()
29428 }
29429}
29430impl Default for STATUSTEXT_DATA {
29431 fn default() -> Self {
29432 Self::DEFAULT.clone()
29433 }
29434}
29435impl MessageData for STATUSTEXT_DATA {
29436 type Message = MavMessage;
29437 const ID: u32 = 253u32;
29438 const NAME: &'static str = "STATUSTEXT";
29439 const EXTRA_CRC: u8 = 83u8;
29440 const ENCODED_LEN: usize = 54usize;
29441 fn deser(
29442 _version: MavlinkVersion,
29443 __input: &[u8],
29444 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29445 let avail_len = __input.len();
29446 let mut payload_buf = [0; Self::ENCODED_LEN];
29447 let mut buf = if avail_len < Self::ENCODED_LEN {
29448 payload_buf[0..avail_len].copy_from_slice(__input);
29449 Bytes::new(&payload_buf)
29450 } else {
29451 Bytes::new(__input)
29452 };
29453 let mut __struct = Self::default();
29454 let tmp = buf.get_u8();
29455 __struct.severity =
29456 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29457 enum_type: "MavSeverity",
29458 value: tmp as u32,
29459 })?;
29460 for v in &mut __struct.text {
29461 let val = buf.get_u8();
29462 *v = val;
29463 }
29464 __struct.id = buf.get_u16_le();
29465 __struct.chunk_seq = buf.get_u8();
29466 Ok(__struct)
29467 }
29468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29469 let mut __tmp = BytesMut::new(bytes);
29470 #[allow(clippy::absurd_extreme_comparisons)]
29471 #[allow(unused_comparisons)]
29472 if __tmp.remaining() < Self::ENCODED_LEN {
29473 panic!(
29474 "buffer is too small (need {} bytes, but got {})",
29475 Self::ENCODED_LEN,
29476 __tmp.remaining(),
29477 )
29478 }
29479 __tmp.put_u8(self.severity as u8);
29480 for val in &self.text {
29481 __tmp.put_u8(*val);
29482 }
29483 if matches!(version, MavlinkVersion::V2) {
29484 __tmp.put_u16_le(self.id);
29485 __tmp.put_u8(self.chunk_seq);
29486 let len = __tmp.len();
29487 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29488 } else {
29489 __tmp.len()
29490 }
29491 }
29492}
29493#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29494#[doc = ""]
29495#[doc = "ID: 261"]
29496#[derive(Debug, Clone, PartialEq)]
29497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29499#[cfg_attr(feature = "ts", derive(TS))]
29500#[cfg_attr(feature = "ts", ts(export))]
29501pub struct STORAGE_INFORMATION_DATA {
29502 #[doc = "Timestamp (time since system boot)."]
29503 pub time_boot_ms: u32,
29504 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29505 pub total_capacity: f32,
29506 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29507 pub used_capacity: f32,
29508 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29509 pub available_capacity: f32,
29510 #[doc = "Read speed."]
29511 pub read_speed: f32,
29512 #[doc = "Write speed."]
29513 pub write_speed: f32,
29514 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29515 pub storage_id: u8,
29516 #[doc = "Number of storage devices"]
29517 pub storage_count: u8,
29518 #[doc = "Status of storage"]
29519 pub status: StorageStatus,
29520 #[doc = "Type of storage"]
29521 #[cfg_attr(feature = "serde", serde(default))]
29522 pub mavtype: StorageType,
29523 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29524 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29525 #[cfg_attr(
29526 feature = "serde",
29527 serde(
29528 serialize_with = "crate::nulstr::serialize::<_, 32>",
29529 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
29530 )
29531 )]
29532 #[cfg_attr(feature = "ts", ts(type = "string"))]
29533 pub name: [u8; 32],
29534 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29535 #[cfg_attr(feature = "serde", serde(default))]
29536 pub storage_usage: StorageUsageFlag,
29537}
29538impl STORAGE_INFORMATION_DATA {
29539 pub const ENCODED_LEN: usize = 61usize;
29540 pub const DEFAULT: Self = Self {
29541 time_boot_ms: 0_u32,
29542 total_capacity: 0.0_f32,
29543 used_capacity: 0.0_f32,
29544 available_capacity: 0.0_f32,
29545 read_speed: 0.0_f32,
29546 write_speed: 0.0_f32,
29547 storage_id: 0_u8,
29548 storage_count: 0_u8,
29549 status: StorageStatus::DEFAULT,
29550 mavtype: StorageType::DEFAULT,
29551 name: [0_u8; 32usize],
29552 storage_usage: StorageUsageFlag::DEFAULT,
29553 };
29554 #[cfg(feature = "arbitrary")]
29555 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29556 use arbitrary::{Arbitrary, Unstructured};
29557 let mut buf = [0u8; 1024];
29558 rng.fill_bytes(&mut buf);
29559 let mut unstructured = Unstructured::new(&buf);
29560 Self::arbitrary(&mut unstructured).unwrap_or_default()
29561 }
29562}
29563impl Default for STORAGE_INFORMATION_DATA {
29564 fn default() -> Self {
29565 Self::DEFAULT.clone()
29566 }
29567}
29568impl MessageData for STORAGE_INFORMATION_DATA {
29569 type Message = MavMessage;
29570 const ID: u32 = 261u32;
29571 const NAME: &'static str = "STORAGE_INFORMATION";
29572 const EXTRA_CRC: u8 = 179u8;
29573 const ENCODED_LEN: usize = 61usize;
29574 fn deser(
29575 _version: MavlinkVersion,
29576 __input: &[u8],
29577 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29578 let avail_len = __input.len();
29579 let mut payload_buf = [0; Self::ENCODED_LEN];
29580 let mut buf = if avail_len < Self::ENCODED_LEN {
29581 payload_buf[0..avail_len].copy_from_slice(__input);
29582 Bytes::new(&payload_buf)
29583 } else {
29584 Bytes::new(__input)
29585 };
29586 let mut __struct = Self::default();
29587 __struct.time_boot_ms = buf.get_u32_le();
29588 __struct.total_capacity = buf.get_f32_le();
29589 __struct.used_capacity = buf.get_f32_le();
29590 __struct.available_capacity = buf.get_f32_le();
29591 __struct.read_speed = buf.get_f32_le();
29592 __struct.write_speed = buf.get_f32_le();
29593 __struct.storage_id = buf.get_u8();
29594 __struct.storage_count = buf.get_u8();
29595 let tmp = buf.get_u8();
29596 __struct.status =
29597 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29598 enum_type: "StorageStatus",
29599 value: tmp as u32,
29600 })?;
29601 let tmp = buf.get_u8();
29602 __struct.mavtype =
29603 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29604 enum_type: "StorageType",
29605 value: tmp as u32,
29606 })?;
29607 for v in &mut __struct.name {
29608 let val = buf.get_u8();
29609 *v = val;
29610 }
29611 let tmp = buf.get_u8();
29612 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
29613 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29614 flag_type: "StorageUsageFlag",
29615 value: tmp as u32,
29616 })?;
29617 Ok(__struct)
29618 }
29619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29620 let mut __tmp = BytesMut::new(bytes);
29621 #[allow(clippy::absurd_extreme_comparisons)]
29622 #[allow(unused_comparisons)]
29623 if __tmp.remaining() < Self::ENCODED_LEN {
29624 panic!(
29625 "buffer is too small (need {} bytes, but got {})",
29626 Self::ENCODED_LEN,
29627 __tmp.remaining(),
29628 )
29629 }
29630 __tmp.put_u32_le(self.time_boot_ms);
29631 __tmp.put_f32_le(self.total_capacity);
29632 __tmp.put_f32_le(self.used_capacity);
29633 __tmp.put_f32_le(self.available_capacity);
29634 __tmp.put_f32_le(self.read_speed);
29635 __tmp.put_f32_le(self.write_speed);
29636 __tmp.put_u8(self.storage_id);
29637 __tmp.put_u8(self.storage_count);
29638 __tmp.put_u8(self.status as u8);
29639 if matches!(version, MavlinkVersion::V2) {
29640 __tmp.put_u8(self.mavtype as u8);
29641 for val in &self.name {
29642 __tmp.put_u8(*val);
29643 }
29644 __tmp.put_u8(self.storage_usage.bits());
29645 let len = __tmp.len();
29646 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29647 } else {
29648 __tmp.len()
29649 }
29650 }
29651}
29652#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29653#[doc = ""]
29654#[doc = "ID: 401"]
29655#[derive(Debug, Clone, PartialEq)]
29656#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29658#[cfg_attr(feature = "ts", derive(TS))]
29659#[cfg_attr(feature = "ts", ts(export))]
29660pub struct SUPPORTED_TUNES_DATA {
29661 #[doc = "Bitfield of supported tune formats."]
29662 pub format: TuneFormat,
29663 #[doc = "System ID"]
29664 pub target_system: u8,
29665 #[doc = "Component ID"]
29666 pub target_component: u8,
29667}
29668impl SUPPORTED_TUNES_DATA {
29669 pub const ENCODED_LEN: usize = 6usize;
29670 pub const DEFAULT: Self = Self {
29671 format: TuneFormat::DEFAULT,
29672 target_system: 0_u8,
29673 target_component: 0_u8,
29674 };
29675 #[cfg(feature = "arbitrary")]
29676 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29677 use arbitrary::{Arbitrary, Unstructured};
29678 let mut buf = [0u8; 1024];
29679 rng.fill_bytes(&mut buf);
29680 let mut unstructured = Unstructured::new(&buf);
29681 Self::arbitrary(&mut unstructured).unwrap_or_default()
29682 }
29683}
29684impl Default for SUPPORTED_TUNES_DATA {
29685 fn default() -> Self {
29686 Self::DEFAULT.clone()
29687 }
29688}
29689impl MessageData for SUPPORTED_TUNES_DATA {
29690 type Message = MavMessage;
29691 const ID: u32 = 401u32;
29692 const NAME: &'static str = "SUPPORTED_TUNES";
29693 const EXTRA_CRC: u8 = 183u8;
29694 const ENCODED_LEN: usize = 6usize;
29695 fn deser(
29696 _version: MavlinkVersion,
29697 __input: &[u8],
29698 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29699 let avail_len = __input.len();
29700 let mut payload_buf = [0; Self::ENCODED_LEN];
29701 let mut buf = if avail_len < Self::ENCODED_LEN {
29702 payload_buf[0..avail_len].copy_from_slice(__input);
29703 Bytes::new(&payload_buf)
29704 } else {
29705 Bytes::new(__input)
29706 };
29707 let mut __struct = Self::default();
29708 let tmp = buf.get_u32_le();
29709 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29710 ::mavlink_core::error::ParserError::InvalidEnum {
29711 enum_type: "TuneFormat",
29712 value: tmp as u32,
29713 },
29714 )?;
29715 __struct.target_system = buf.get_u8();
29716 __struct.target_component = buf.get_u8();
29717 Ok(__struct)
29718 }
29719 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29720 let mut __tmp = BytesMut::new(bytes);
29721 #[allow(clippy::absurd_extreme_comparisons)]
29722 #[allow(unused_comparisons)]
29723 if __tmp.remaining() < Self::ENCODED_LEN {
29724 panic!(
29725 "buffer is too small (need {} bytes, but got {})",
29726 Self::ENCODED_LEN,
29727 __tmp.remaining(),
29728 )
29729 }
29730 __tmp.put_u32_le(self.format as u32);
29731 __tmp.put_u8(self.target_system);
29732 __tmp.put_u8(self.target_component);
29733 if matches!(version, MavlinkVersion::V2) {
29734 let len = __tmp.len();
29735 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29736 } else {
29737 __tmp.len()
29738 }
29739 }
29740}
29741#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29742#[doc = ""]
29743#[doc = "ID: 2"]
29744#[derive(Debug, Clone, PartialEq)]
29745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29747#[cfg_attr(feature = "ts", derive(TS))]
29748#[cfg_attr(feature = "ts", ts(export))]
29749pub struct SYSTEM_TIME_DATA {
29750 #[doc = "Timestamp (UNIX epoch time)."]
29751 pub time_unix_usec: u64,
29752 #[doc = "Timestamp (time since system boot)."]
29753 pub time_boot_ms: u32,
29754}
29755impl SYSTEM_TIME_DATA {
29756 pub const ENCODED_LEN: usize = 12usize;
29757 pub const DEFAULT: Self = Self {
29758 time_unix_usec: 0_u64,
29759 time_boot_ms: 0_u32,
29760 };
29761 #[cfg(feature = "arbitrary")]
29762 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29763 use arbitrary::{Arbitrary, Unstructured};
29764 let mut buf = [0u8; 1024];
29765 rng.fill_bytes(&mut buf);
29766 let mut unstructured = Unstructured::new(&buf);
29767 Self::arbitrary(&mut unstructured).unwrap_or_default()
29768 }
29769}
29770impl Default for SYSTEM_TIME_DATA {
29771 fn default() -> Self {
29772 Self::DEFAULT.clone()
29773 }
29774}
29775impl MessageData for SYSTEM_TIME_DATA {
29776 type Message = MavMessage;
29777 const ID: u32 = 2u32;
29778 const NAME: &'static str = "SYSTEM_TIME";
29779 const EXTRA_CRC: u8 = 137u8;
29780 const ENCODED_LEN: usize = 12usize;
29781 fn deser(
29782 _version: MavlinkVersion,
29783 __input: &[u8],
29784 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29785 let avail_len = __input.len();
29786 let mut payload_buf = [0; Self::ENCODED_LEN];
29787 let mut buf = if avail_len < Self::ENCODED_LEN {
29788 payload_buf[0..avail_len].copy_from_slice(__input);
29789 Bytes::new(&payload_buf)
29790 } else {
29791 Bytes::new(__input)
29792 };
29793 let mut __struct = Self::default();
29794 __struct.time_unix_usec = buf.get_u64_le();
29795 __struct.time_boot_ms = buf.get_u32_le();
29796 Ok(__struct)
29797 }
29798 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29799 let mut __tmp = BytesMut::new(bytes);
29800 #[allow(clippy::absurd_extreme_comparisons)]
29801 #[allow(unused_comparisons)]
29802 if __tmp.remaining() < Self::ENCODED_LEN {
29803 panic!(
29804 "buffer is too small (need {} bytes, but got {})",
29805 Self::ENCODED_LEN,
29806 __tmp.remaining(),
29807 )
29808 }
29809 __tmp.put_u64_le(self.time_unix_usec);
29810 __tmp.put_u32_le(self.time_boot_ms);
29811 if matches!(version, MavlinkVersion::V2) {
29812 let len = __tmp.len();
29813 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29814 } else {
29815 __tmp.len()
29816 }
29817 }
29818}
29819#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29820#[doc = ""]
29821#[doc = "ID: 1"]
29822#[derive(Debug, Clone, PartialEq)]
29823#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29825#[cfg_attr(feature = "ts", derive(TS))]
29826#[cfg_attr(feature = "ts", ts(export))]
29827pub struct SYS_STATUS_DATA {
29828 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29829 pub onboard_control_sensors_present: MavSysStatusSensor,
29830 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29831 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29832 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29833 pub onboard_control_sensors_health: MavSysStatusSensor,
29834 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29835 pub load: u16,
29836 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29837 pub voltage_battery: u16,
29838 #[doc = "Battery current, -1: Current not sent by autopilot"]
29839 pub current_battery: i16,
29840 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29841 pub drop_rate_comm: u16,
29842 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29843 pub errors_comm: u16,
29844 #[doc = "Autopilot-specific errors"]
29845 pub errors_count1: u16,
29846 #[doc = "Autopilot-specific errors"]
29847 pub errors_count2: u16,
29848 #[doc = "Autopilot-specific errors"]
29849 pub errors_count3: u16,
29850 #[doc = "Autopilot-specific errors"]
29851 pub errors_count4: u16,
29852 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29853 pub battery_remaining: i8,
29854 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29855 #[cfg_attr(feature = "serde", serde(default))]
29856 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29857 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29858 #[cfg_attr(feature = "serde", serde(default))]
29859 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29860 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29861 #[cfg_attr(feature = "serde", serde(default))]
29862 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29863}
29864impl SYS_STATUS_DATA {
29865 pub const ENCODED_LEN: usize = 43usize;
29866 pub const DEFAULT: Self = Self {
29867 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29868 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29869 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29870 load: 0_u16,
29871 voltage_battery: 0_u16,
29872 current_battery: 0_i16,
29873 drop_rate_comm: 0_u16,
29874 errors_comm: 0_u16,
29875 errors_count1: 0_u16,
29876 errors_count2: 0_u16,
29877 errors_count3: 0_u16,
29878 errors_count4: 0_u16,
29879 battery_remaining: 0_i8,
29880 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29881 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29882 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29883 };
29884 #[cfg(feature = "arbitrary")]
29885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29886 use arbitrary::{Arbitrary, Unstructured};
29887 let mut buf = [0u8; 1024];
29888 rng.fill_bytes(&mut buf);
29889 let mut unstructured = Unstructured::new(&buf);
29890 Self::arbitrary(&mut unstructured).unwrap_or_default()
29891 }
29892}
29893impl Default for SYS_STATUS_DATA {
29894 fn default() -> Self {
29895 Self::DEFAULT.clone()
29896 }
29897}
29898impl MessageData for SYS_STATUS_DATA {
29899 type Message = MavMessage;
29900 const ID: u32 = 1u32;
29901 const NAME: &'static str = "SYS_STATUS";
29902 const EXTRA_CRC: u8 = 124u8;
29903 const ENCODED_LEN: usize = 43usize;
29904 fn deser(
29905 _version: MavlinkVersion,
29906 __input: &[u8],
29907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29908 let avail_len = __input.len();
29909 let mut payload_buf = [0; Self::ENCODED_LEN];
29910 let mut buf = if avail_len < Self::ENCODED_LEN {
29911 payload_buf[0..avail_len].copy_from_slice(__input);
29912 Bytes::new(&payload_buf)
29913 } else {
29914 Bytes::new(__input)
29915 };
29916 let mut __struct = Self::default();
29917 let tmp = buf.get_u32_le();
29918 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
29919 tmp & MavSysStatusSensor::all().bits(),
29920 )
29921 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29922 flag_type: "MavSysStatusSensor",
29923 value: tmp as u32,
29924 })?;
29925 let tmp = buf.get_u32_le();
29926 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
29927 tmp & MavSysStatusSensor::all().bits(),
29928 )
29929 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29930 flag_type: "MavSysStatusSensor",
29931 value: tmp as u32,
29932 })?;
29933 let tmp = buf.get_u32_le();
29934 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
29935 tmp & MavSysStatusSensor::all().bits(),
29936 )
29937 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29938 flag_type: "MavSysStatusSensor",
29939 value: tmp as u32,
29940 })?;
29941 __struct.load = buf.get_u16_le();
29942 __struct.voltage_battery = buf.get_u16_le();
29943 __struct.current_battery = buf.get_i16_le();
29944 __struct.drop_rate_comm = buf.get_u16_le();
29945 __struct.errors_comm = buf.get_u16_le();
29946 __struct.errors_count1 = buf.get_u16_le();
29947 __struct.errors_count2 = buf.get_u16_le();
29948 __struct.errors_count3 = buf.get_u16_le();
29949 __struct.errors_count4 = buf.get_u16_le();
29950 __struct.battery_remaining = buf.get_i8();
29951 let tmp = buf.get_u32_le();
29952 __struct.onboard_control_sensors_present_extended =
29953 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29954 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29955 flag_type: "MavSysStatusSensorExtended",
29956 value: tmp as u32,
29957 })?;
29958 let tmp = buf.get_u32_le();
29959 __struct.onboard_control_sensors_enabled_extended =
29960 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29961 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29962 flag_type: "MavSysStatusSensorExtended",
29963 value: tmp as u32,
29964 })?;
29965 let tmp = buf.get_u32_le();
29966 __struct.onboard_control_sensors_health_extended =
29967 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
29968 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29969 flag_type: "MavSysStatusSensorExtended",
29970 value: tmp as u32,
29971 })?;
29972 Ok(__struct)
29973 }
29974 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29975 let mut __tmp = BytesMut::new(bytes);
29976 #[allow(clippy::absurd_extreme_comparisons)]
29977 #[allow(unused_comparisons)]
29978 if __tmp.remaining() < Self::ENCODED_LEN {
29979 panic!(
29980 "buffer is too small (need {} bytes, but got {})",
29981 Self::ENCODED_LEN,
29982 __tmp.remaining(),
29983 )
29984 }
29985 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
29986 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
29987 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
29988 __tmp.put_u16_le(self.load);
29989 __tmp.put_u16_le(self.voltage_battery);
29990 __tmp.put_i16_le(self.current_battery);
29991 __tmp.put_u16_le(self.drop_rate_comm);
29992 __tmp.put_u16_le(self.errors_comm);
29993 __tmp.put_u16_le(self.errors_count1);
29994 __tmp.put_u16_le(self.errors_count2);
29995 __tmp.put_u16_le(self.errors_count3);
29996 __tmp.put_u16_le(self.errors_count4);
29997 __tmp.put_i8(self.battery_remaining);
29998 if matches!(version, MavlinkVersion::V2) {
29999 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
30000 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
30001 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
30002 let len = __tmp.len();
30003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30004 } else {
30005 __tmp.len()
30006 }
30007 }
30008}
30009#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
30010#[doc = ""]
30011#[doc = "ID: 135"]
30012#[derive(Debug, Clone, PartialEq)]
30013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30015#[cfg_attr(feature = "ts", derive(TS))]
30016#[cfg_attr(feature = "ts", ts(export))]
30017pub struct TERRAIN_CHECK_DATA {
30018 #[doc = "Latitude"]
30019 pub lat: i32,
30020 #[doc = "Longitude"]
30021 pub lon: i32,
30022}
30023impl TERRAIN_CHECK_DATA {
30024 pub const ENCODED_LEN: usize = 8usize;
30025 pub const DEFAULT: Self = Self {
30026 lat: 0_i32,
30027 lon: 0_i32,
30028 };
30029 #[cfg(feature = "arbitrary")]
30030 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30031 use arbitrary::{Arbitrary, Unstructured};
30032 let mut buf = [0u8; 1024];
30033 rng.fill_bytes(&mut buf);
30034 let mut unstructured = Unstructured::new(&buf);
30035 Self::arbitrary(&mut unstructured).unwrap_or_default()
30036 }
30037}
30038impl Default for TERRAIN_CHECK_DATA {
30039 fn default() -> Self {
30040 Self::DEFAULT.clone()
30041 }
30042}
30043impl MessageData for TERRAIN_CHECK_DATA {
30044 type Message = MavMessage;
30045 const ID: u32 = 135u32;
30046 const NAME: &'static str = "TERRAIN_CHECK";
30047 const EXTRA_CRC: u8 = 203u8;
30048 const ENCODED_LEN: usize = 8usize;
30049 fn deser(
30050 _version: MavlinkVersion,
30051 __input: &[u8],
30052 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30053 let avail_len = __input.len();
30054 let mut payload_buf = [0; Self::ENCODED_LEN];
30055 let mut buf = if avail_len < Self::ENCODED_LEN {
30056 payload_buf[0..avail_len].copy_from_slice(__input);
30057 Bytes::new(&payload_buf)
30058 } else {
30059 Bytes::new(__input)
30060 };
30061 let mut __struct = Self::default();
30062 __struct.lat = buf.get_i32_le();
30063 __struct.lon = buf.get_i32_le();
30064 Ok(__struct)
30065 }
30066 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30067 let mut __tmp = BytesMut::new(bytes);
30068 #[allow(clippy::absurd_extreme_comparisons)]
30069 #[allow(unused_comparisons)]
30070 if __tmp.remaining() < Self::ENCODED_LEN {
30071 panic!(
30072 "buffer is too small (need {} bytes, but got {})",
30073 Self::ENCODED_LEN,
30074 __tmp.remaining(),
30075 )
30076 }
30077 __tmp.put_i32_le(self.lat);
30078 __tmp.put_i32_le(self.lon);
30079 if matches!(version, MavlinkVersion::V2) {
30080 let len = __tmp.len();
30081 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30082 } else {
30083 __tmp.len()
30084 }
30085 }
30086}
30087#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30088#[doc = ""]
30089#[doc = "ID: 134"]
30090#[derive(Debug, Clone, PartialEq)]
30091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30093#[cfg_attr(feature = "ts", derive(TS))]
30094#[cfg_attr(feature = "ts", ts(export))]
30095pub struct TERRAIN_DATA_DATA {
30096 #[doc = "Latitude of SW corner of first grid"]
30097 pub lat: i32,
30098 #[doc = "Longitude of SW corner of first grid"]
30099 pub lon: i32,
30100 #[doc = "Grid spacing"]
30101 pub grid_spacing: u16,
30102 #[doc = "Terrain data MSL"]
30103 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30104 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30105 pub data: [i16; 16],
30106 #[doc = "bit within the terrain request mask"]
30107 pub gridbit: u8,
30108}
30109impl TERRAIN_DATA_DATA {
30110 pub const ENCODED_LEN: usize = 43usize;
30111 pub const DEFAULT: Self = Self {
30112 lat: 0_i32,
30113 lon: 0_i32,
30114 grid_spacing: 0_u16,
30115 data: [0_i16; 16usize],
30116 gridbit: 0_u8,
30117 };
30118 #[cfg(feature = "arbitrary")]
30119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30120 use arbitrary::{Arbitrary, Unstructured};
30121 let mut buf = [0u8; 1024];
30122 rng.fill_bytes(&mut buf);
30123 let mut unstructured = Unstructured::new(&buf);
30124 Self::arbitrary(&mut unstructured).unwrap_or_default()
30125 }
30126}
30127impl Default for TERRAIN_DATA_DATA {
30128 fn default() -> Self {
30129 Self::DEFAULT.clone()
30130 }
30131}
30132impl MessageData for TERRAIN_DATA_DATA {
30133 type Message = MavMessage;
30134 const ID: u32 = 134u32;
30135 const NAME: &'static str = "TERRAIN_DATA";
30136 const EXTRA_CRC: u8 = 229u8;
30137 const ENCODED_LEN: usize = 43usize;
30138 fn deser(
30139 _version: MavlinkVersion,
30140 __input: &[u8],
30141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30142 let avail_len = __input.len();
30143 let mut payload_buf = [0; Self::ENCODED_LEN];
30144 let mut buf = if avail_len < Self::ENCODED_LEN {
30145 payload_buf[0..avail_len].copy_from_slice(__input);
30146 Bytes::new(&payload_buf)
30147 } else {
30148 Bytes::new(__input)
30149 };
30150 let mut __struct = Self::default();
30151 __struct.lat = buf.get_i32_le();
30152 __struct.lon = buf.get_i32_le();
30153 __struct.grid_spacing = buf.get_u16_le();
30154 for v in &mut __struct.data {
30155 let val = buf.get_i16_le();
30156 *v = val;
30157 }
30158 __struct.gridbit = buf.get_u8();
30159 Ok(__struct)
30160 }
30161 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30162 let mut __tmp = BytesMut::new(bytes);
30163 #[allow(clippy::absurd_extreme_comparisons)]
30164 #[allow(unused_comparisons)]
30165 if __tmp.remaining() < Self::ENCODED_LEN {
30166 panic!(
30167 "buffer is too small (need {} bytes, but got {})",
30168 Self::ENCODED_LEN,
30169 __tmp.remaining(),
30170 )
30171 }
30172 __tmp.put_i32_le(self.lat);
30173 __tmp.put_i32_le(self.lon);
30174 __tmp.put_u16_le(self.grid_spacing);
30175 for val in &self.data {
30176 __tmp.put_i16_le(*val);
30177 }
30178 __tmp.put_u8(self.gridbit);
30179 if matches!(version, MavlinkVersion::V2) {
30180 let len = __tmp.len();
30181 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30182 } else {
30183 __tmp.len()
30184 }
30185 }
30186}
30187#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30188#[doc = ""]
30189#[doc = "ID: 136"]
30190#[derive(Debug, Clone, PartialEq)]
30191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30192#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30193#[cfg_attr(feature = "ts", derive(TS))]
30194#[cfg_attr(feature = "ts", ts(export))]
30195pub struct TERRAIN_REPORT_DATA {
30196 #[doc = "Latitude"]
30197 pub lat: i32,
30198 #[doc = "Longitude"]
30199 pub lon: i32,
30200 #[doc = "Terrain height MSL"]
30201 pub terrain_height: f32,
30202 #[doc = "Current vehicle height above lat/lon terrain height"]
30203 pub current_height: f32,
30204 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
30205 pub spacing: u16,
30206 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
30207 pub pending: u16,
30208 #[doc = "Number of 4x4 terrain blocks in memory"]
30209 pub loaded: u16,
30210}
30211impl TERRAIN_REPORT_DATA {
30212 pub const ENCODED_LEN: usize = 22usize;
30213 pub const DEFAULT: Self = Self {
30214 lat: 0_i32,
30215 lon: 0_i32,
30216 terrain_height: 0.0_f32,
30217 current_height: 0.0_f32,
30218 spacing: 0_u16,
30219 pending: 0_u16,
30220 loaded: 0_u16,
30221 };
30222 #[cfg(feature = "arbitrary")]
30223 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30224 use arbitrary::{Arbitrary, Unstructured};
30225 let mut buf = [0u8; 1024];
30226 rng.fill_bytes(&mut buf);
30227 let mut unstructured = Unstructured::new(&buf);
30228 Self::arbitrary(&mut unstructured).unwrap_or_default()
30229 }
30230}
30231impl Default for TERRAIN_REPORT_DATA {
30232 fn default() -> Self {
30233 Self::DEFAULT.clone()
30234 }
30235}
30236impl MessageData for TERRAIN_REPORT_DATA {
30237 type Message = MavMessage;
30238 const ID: u32 = 136u32;
30239 const NAME: &'static str = "TERRAIN_REPORT";
30240 const EXTRA_CRC: u8 = 1u8;
30241 const ENCODED_LEN: usize = 22usize;
30242 fn deser(
30243 _version: MavlinkVersion,
30244 __input: &[u8],
30245 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30246 let avail_len = __input.len();
30247 let mut payload_buf = [0; Self::ENCODED_LEN];
30248 let mut buf = if avail_len < Self::ENCODED_LEN {
30249 payload_buf[0..avail_len].copy_from_slice(__input);
30250 Bytes::new(&payload_buf)
30251 } else {
30252 Bytes::new(__input)
30253 };
30254 let mut __struct = Self::default();
30255 __struct.lat = buf.get_i32_le();
30256 __struct.lon = buf.get_i32_le();
30257 __struct.terrain_height = buf.get_f32_le();
30258 __struct.current_height = buf.get_f32_le();
30259 __struct.spacing = buf.get_u16_le();
30260 __struct.pending = buf.get_u16_le();
30261 __struct.loaded = buf.get_u16_le();
30262 Ok(__struct)
30263 }
30264 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30265 let mut __tmp = BytesMut::new(bytes);
30266 #[allow(clippy::absurd_extreme_comparisons)]
30267 #[allow(unused_comparisons)]
30268 if __tmp.remaining() < Self::ENCODED_LEN {
30269 panic!(
30270 "buffer is too small (need {} bytes, but got {})",
30271 Self::ENCODED_LEN,
30272 __tmp.remaining(),
30273 )
30274 }
30275 __tmp.put_i32_le(self.lat);
30276 __tmp.put_i32_le(self.lon);
30277 __tmp.put_f32_le(self.terrain_height);
30278 __tmp.put_f32_le(self.current_height);
30279 __tmp.put_u16_le(self.spacing);
30280 __tmp.put_u16_le(self.pending);
30281 __tmp.put_u16_le(self.loaded);
30282 if matches!(version, MavlinkVersion::V2) {
30283 let len = __tmp.len();
30284 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30285 } else {
30286 __tmp.len()
30287 }
30288 }
30289}
30290#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30291#[doc = ""]
30292#[doc = "ID: 133"]
30293#[derive(Debug, Clone, PartialEq)]
30294#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30295#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30296#[cfg_attr(feature = "ts", derive(TS))]
30297#[cfg_attr(feature = "ts", ts(export))]
30298pub struct TERRAIN_REQUEST_DATA {
30299 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
30300 pub mask: u64,
30301 #[doc = "Latitude of SW corner of first grid"]
30302 pub lat: i32,
30303 #[doc = "Longitude of SW corner of first grid"]
30304 pub lon: i32,
30305 #[doc = "Grid spacing"]
30306 pub grid_spacing: u16,
30307}
30308impl TERRAIN_REQUEST_DATA {
30309 pub const ENCODED_LEN: usize = 18usize;
30310 pub const DEFAULT: Self = Self {
30311 mask: 0_u64,
30312 lat: 0_i32,
30313 lon: 0_i32,
30314 grid_spacing: 0_u16,
30315 };
30316 #[cfg(feature = "arbitrary")]
30317 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30318 use arbitrary::{Arbitrary, Unstructured};
30319 let mut buf = [0u8; 1024];
30320 rng.fill_bytes(&mut buf);
30321 let mut unstructured = Unstructured::new(&buf);
30322 Self::arbitrary(&mut unstructured).unwrap_or_default()
30323 }
30324}
30325impl Default for TERRAIN_REQUEST_DATA {
30326 fn default() -> Self {
30327 Self::DEFAULT.clone()
30328 }
30329}
30330impl MessageData for TERRAIN_REQUEST_DATA {
30331 type Message = MavMessage;
30332 const ID: u32 = 133u32;
30333 const NAME: &'static str = "TERRAIN_REQUEST";
30334 const EXTRA_CRC: u8 = 6u8;
30335 const ENCODED_LEN: usize = 18usize;
30336 fn deser(
30337 _version: MavlinkVersion,
30338 __input: &[u8],
30339 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30340 let avail_len = __input.len();
30341 let mut payload_buf = [0; Self::ENCODED_LEN];
30342 let mut buf = if avail_len < Self::ENCODED_LEN {
30343 payload_buf[0..avail_len].copy_from_slice(__input);
30344 Bytes::new(&payload_buf)
30345 } else {
30346 Bytes::new(__input)
30347 };
30348 let mut __struct = Self::default();
30349 __struct.mask = buf.get_u64_le();
30350 __struct.lat = buf.get_i32_le();
30351 __struct.lon = buf.get_i32_le();
30352 __struct.grid_spacing = buf.get_u16_le();
30353 Ok(__struct)
30354 }
30355 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30356 let mut __tmp = BytesMut::new(bytes);
30357 #[allow(clippy::absurd_extreme_comparisons)]
30358 #[allow(unused_comparisons)]
30359 if __tmp.remaining() < Self::ENCODED_LEN {
30360 panic!(
30361 "buffer is too small (need {} bytes, but got {})",
30362 Self::ENCODED_LEN,
30363 __tmp.remaining(),
30364 )
30365 }
30366 __tmp.put_u64_le(self.mask);
30367 __tmp.put_i32_le(self.lat);
30368 __tmp.put_i32_le(self.lon);
30369 __tmp.put_u16_le(self.grid_spacing);
30370 if matches!(version, MavlinkVersion::V2) {
30371 let len = __tmp.len();
30372 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30373 } else {
30374 __tmp.len()
30375 }
30376 }
30377}
30378#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
30379#[doc = ""]
30380#[doc = "ID: 111"]
30381#[derive(Debug, Clone, PartialEq)]
30382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30384#[cfg_attr(feature = "ts", derive(TS))]
30385#[cfg_attr(feature = "ts", ts(export))]
30386pub struct TIMESYNC_DATA {
30387 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
30388 pub tc1: i64,
30389 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
30390 pub ts1: i64,
30391 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
30392 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30393 pub target_system: u8,
30394 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
30395 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30396 pub target_component: u8,
30397}
30398impl TIMESYNC_DATA {
30399 pub const ENCODED_LEN: usize = 18usize;
30400 pub const DEFAULT: Self = Self {
30401 tc1: 0_i64,
30402 ts1: 0_i64,
30403 target_system: 0_u8,
30404 target_component: 0_u8,
30405 };
30406 #[cfg(feature = "arbitrary")]
30407 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30408 use arbitrary::{Arbitrary, Unstructured};
30409 let mut buf = [0u8; 1024];
30410 rng.fill_bytes(&mut buf);
30411 let mut unstructured = Unstructured::new(&buf);
30412 Self::arbitrary(&mut unstructured).unwrap_or_default()
30413 }
30414}
30415impl Default for TIMESYNC_DATA {
30416 fn default() -> Self {
30417 Self::DEFAULT.clone()
30418 }
30419}
30420impl MessageData for TIMESYNC_DATA {
30421 type Message = MavMessage;
30422 const ID: u32 = 111u32;
30423 const NAME: &'static str = "TIMESYNC";
30424 const EXTRA_CRC: u8 = 34u8;
30425 const ENCODED_LEN: usize = 18usize;
30426 fn deser(
30427 _version: MavlinkVersion,
30428 __input: &[u8],
30429 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30430 let avail_len = __input.len();
30431 let mut payload_buf = [0; Self::ENCODED_LEN];
30432 let mut buf = if avail_len < Self::ENCODED_LEN {
30433 payload_buf[0..avail_len].copy_from_slice(__input);
30434 Bytes::new(&payload_buf)
30435 } else {
30436 Bytes::new(__input)
30437 };
30438 let mut __struct = Self::default();
30439 __struct.tc1 = buf.get_i64_le();
30440 __struct.ts1 = buf.get_i64_le();
30441 __struct.target_system = buf.get_u8();
30442 __struct.target_component = buf.get_u8();
30443 Ok(__struct)
30444 }
30445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30446 let mut __tmp = BytesMut::new(bytes);
30447 #[allow(clippy::absurd_extreme_comparisons)]
30448 #[allow(unused_comparisons)]
30449 if __tmp.remaining() < Self::ENCODED_LEN {
30450 panic!(
30451 "buffer is too small (need {} bytes, but got {})",
30452 Self::ENCODED_LEN,
30453 __tmp.remaining(),
30454 )
30455 }
30456 __tmp.put_i64_le(self.tc1);
30457 __tmp.put_i64_le(self.ts1);
30458 if matches!(version, MavlinkVersion::V2) {
30459 __tmp.put_u8(self.target_system);
30460 __tmp.put_u8(self.target_component);
30461 let len = __tmp.len();
30462 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30463 } else {
30464 __tmp.len()
30465 }
30466 }
30467}
30468#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30469#[doc = ""]
30470#[doc = "ID: 380"]
30471#[derive(Debug, Clone, PartialEq)]
30472#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30473#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30474#[cfg_attr(feature = "ts", derive(TS))]
30475#[cfg_attr(feature = "ts", ts(export))]
30476pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30477 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30478 pub safe_return: i32,
30479 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30480 pub land: i32,
30481 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30482 pub mission_next_item: i32,
30483 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30484 pub mission_end: i32,
30485 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30486 pub commanded_action: i32,
30487}
30488impl TIME_ESTIMATE_TO_TARGET_DATA {
30489 pub const ENCODED_LEN: usize = 20usize;
30490 pub const DEFAULT: Self = Self {
30491 safe_return: 0_i32,
30492 land: 0_i32,
30493 mission_next_item: 0_i32,
30494 mission_end: 0_i32,
30495 commanded_action: 0_i32,
30496 };
30497 #[cfg(feature = "arbitrary")]
30498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30499 use arbitrary::{Arbitrary, Unstructured};
30500 let mut buf = [0u8; 1024];
30501 rng.fill_bytes(&mut buf);
30502 let mut unstructured = Unstructured::new(&buf);
30503 Self::arbitrary(&mut unstructured).unwrap_or_default()
30504 }
30505}
30506impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30507 fn default() -> Self {
30508 Self::DEFAULT.clone()
30509 }
30510}
30511impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30512 type Message = MavMessage;
30513 const ID: u32 = 380u32;
30514 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30515 const EXTRA_CRC: u8 = 232u8;
30516 const ENCODED_LEN: usize = 20usize;
30517 fn deser(
30518 _version: MavlinkVersion,
30519 __input: &[u8],
30520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30521 let avail_len = __input.len();
30522 let mut payload_buf = [0; Self::ENCODED_LEN];
30523 let mut buf = if avail_len < Self::ENCODED_LEN {
30524 payload_buf[0..avail_len].copy_from_slice(__input);
30525 Bytes::new(&payload_buf)
30526 } else {
30527 Bytes::new(__input)
30528 };
30529 let mut __struct = Self::default();
30530 __struct.safe_return = buf.get_i32_le();
30531 __struct.land = buf.get_i32_le();
30532 __struct.mission_next_item = buf.get_i32_le();
30533 __struct.mission_end = buf.get_i32_le();
30534 __struct.commanded_action = buf.get_i32_le();
30535 Ok(__struct)
30536 }
30537 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30538 let mut __tmp = BytesMut::new(bytes);
30539 #[allow(clippy::absurd_extreme_comparisons)]
30540 #[allow(unused_comparisons)]
30541 if __tmp.remaining() < Self::ENCODED_LEN {
30542 panic!(
30543 "buffer is too small (need {} bytes, but got {})",
30544 Self::ENCODED_LEN,
30545 __tmp.remaining(),
30546 )
30547 }
30548 __tmp.put_i32_le(self.safe_return);
30549 __tmp.put_i32_le(self.land);
30550 __tmp.put_i32_le(self.mission_next_item);
30551 __tmp.put_i32_le(self.mission_end);
30552 __tmp.put_i32_le(self.commanded_action);
30553 if matches!(version, MavlinkVersion::V2) {
30554 let len = __tmp.len();
30555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30556 } else {
30557 __tmp.len()
30558 }
30559 }
30560}
30561#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30562#[doc = ""]
30563#[doc = "ID: 333"]
30564#[derive(Debug, Clone, PartialEq)]
30565#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30567#[cfg_attr(feature = "ts", derive(TS))]
30568#[cfg_attr(feature = "ts", ts(export))]
30569pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30570 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30571 pub time_usec: u64,
30572 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30573 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30574 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30575 pub pos_x: [f32; 5],
30576 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30577 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30578 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30579 pub pos_y: [f32; 5],
30580 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30581 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30582 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30583 pub pos_z: [f32; 5],
30584 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30585 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30586 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30587 pub delta: [f32; 5],
30588 #[doc = "Yaw. Set to NaN for unchanged"]
30589 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30590 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30591 pub pos_yaw: [f32; 5],
30592 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30593 pub valid_points: u8,
30594}
30595impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30596 pub const ENCODED_LEN: usize = 109usize;
30597 pub const DEFAULT: Self = Self {
30598 time_usec: 0_u64,
30599 pos_x: [0.0_f32; 5usize],
30600 pos_y: [0.0_f32; 5usize],
30601 pos_z: [0.0_f32; 5usize],
30602 delta: [0.0_f32; 5usize],
30603 pos_yaw: [0.0_f32; 5usize],
30604 valid_points: 0_u8,
30605 };
30606 #[cfg(feature = "arbitrary")]
30607 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30608 use arbitrary::{Arbitrary, Unstructured};
30609 let mut buf = [0u8; 1024];
30610 rng.fill_bytes(&mut buf);
30611 let mut unstructured = Unstructured::new(&buf);
30612 Self::arbitrary(&mut unstructured).unwrap_or_default()
30613 }
30614}
30615impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30616 fn default() -> Self {
30617 Self::DEFAULT.clone()
30618 }
30619}
30620impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30621 type Message = MavMessage;
30622 const ID: u32 = 333u32;
30623 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30624 const EXTRA_CRC: u8 = 231u8;
30625 const ENCODED_LEN: usize = 109usize;
30626 fn deser(
30627 _version: MavlinkVersion,
30628 __input: &[u8],
30629 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30630 let avail_len = __input.len();
30631 let mut payload_buf = [0; Self::ENCODED_LEN];
30632 let mut buf = if avail_len < Self::ENCODED_LEN {
30633 payload_buf[0..avail_len].copy_from_slice(__input);
30634 Bytes::new(&payload_buf)
30635 } else {
30636 Bytes::new(__input)
30637 };
30638 let mut __struct = Self::default();
30639 __struct.time_usec = buf.get_u64_le();
30640 for v in &mut __struct.pos_x {
30641 let val = buf.get_f32_le();
30642 *v = val;
30643 }
30644 for v in &mut __struct.pos_y {
30645 let val = buf.get_f32_le();
30646 *v = val;
30647 }
30648 for v in &mut __struct.pos_z {
30649 let val = buf.get_f32_le();
30650 *v = val;
30651 }
30652 for v in &mut __struct.delta {
30653 let val = buf.get_f32_le();
30654 *v = val;
30655 }
30656 for v in &mut __struct.pos_yaw {
30657 let val = buf.get_f32_le();
30658 *v = val;
30659 }
30660 __struct.valid_points = buf.get_u8();
30661 Ok(__struct)
30662 }
30663 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30664 let mut __tmp = BytesMut::new(bytes);
30665 #[allow(clippy::absurd_extreme_comparisons)]
30666 #[allow(unused_comparisons)]
30667 if __tmp.remaining() < Self::ENCODED_LEN {
30668 panic!(
30669 "buffer is too small (need {} bytes, but got {})",
30670 Self::ENCODED_LEN,
30671 __tmp.remaining(),
30672 )
30673 }
30674 __tmp.put_u64_le(self.time_usec);
30675 for val in &self.pos_x {
30676 __tmp.put_f32_le(*val);
30677 }
30678 for val in &self.pos_y {
30679 __tmp.put_f32_le(*val);
30680 }
30681 for val in &self.pos_z {
30682 __tmp.put_f32_le(*val);
30683 }
30684 for val in &self.delta {
30685 __tmp.put_f32_le(*val);
30686 }
30687 for val in &self.pos_yaw {
30688 __tmp.put_f32_le(*val);
30689 }
30690 __tmp.put_u8(self.valid_points);
30691 if matches!(version, MavlinkVersion::V2) {
30692 let len = __tmp.len();
30693 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30694 } else {
30695 __tmp.len()
30696 }
30697 }
30698}
30699#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30700#[doc = ""]
30701#[doc = "ID: 332"]
30702#[derive(Debug, Clone, PartialEq)]
30703#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30704#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30705#[cfg_attr(feature = "ts", derive(TS))]
30706#[cfg_attr(feature = "ts", ts(export))]
30707pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30708 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30709 pub time_usec: u64,
30710 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30711 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30712 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30713 pub pos_x: [f32; 5],
30714 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30715 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30716 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30717 pub pos_y: [f32; 5],
30718 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30719 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30720 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30721 pub pos_z: [f32; 5],
30722 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30723 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30724 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30725 pub vel_x: [f32; 5],
30726 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30727 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30728 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30729 pub vel_y: [f32; 5],
30730 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30731 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30732 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30733 pub vel_z: [f32; 5],
30734 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30735 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30736 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30737 pub acc_x: [f32; 5],
30738 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30739 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30740 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30741 pub acc_y: [f32; 5],
30742 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30743 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30744 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30745 pub acc_z: [f32; 5],
30746 #[doc = "Yaw angle, set to NaN if not being used"]
30747 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30748 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30749 pub pos_yaw: [f32; 5],
30750 #[doc = "Yaw rate, set to NaN if not being used"]
30751 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30752 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30753 pub vel_yaw: [f32; 5],
30754 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30755 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30756 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30757 pub command: [u16; 5],
30758 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30759 pub valid_points: u8,
30760}
30761impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30762 pub const ENCODED_LEN: usize = 239usize;
30763 pub const DEFAULT: Self = Self {
30764 time_usec: 0_u64,
30765 pos_x: [0.0_f32; 5usize],
30766 pos_y: [0.0_f32; 5usize],
30767 pos_z: [0.0_f32; 5usize],
30768 vel_x: [0.0_f32; 5usize],
30769 vel_y: [0.0_f32; 5usize],
30770 vel_z: [0.0_f32; 5usize],
30771 acc_x: [0.0_f32; 5usize],
30772 acc_y: [0.0_f32; 5usize],
30773 acc_z: [0.0_f32; 5usize],
30774 pos_yaw: [0.0_f32; 5usize],
30775 vel_yaw: [0.0_f32; 5usize],
30776 command: [0_u16; 5usize],
30777 valid_points: 0_u8,
30778 };
30779 #[cfg(feature = "arbitrary")]
30780 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30781 use arbitrary::{Arbitrary, Unstructured};
30782 let mut buf = [0u8; 1024];
30783 rng.fill_bytes(&mut buf);
30784 let mut unstructured = Unstructured::new(&buf);
30785 Self::arbitrary(&mut unstructured).unwrap_or_default()
30786 }
30787}
30788impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30789 fn default() -> Self {
30790 Self::DEFAULT.clone()
30791 }
30792}
30793impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30794 type Message = MavMessage;
30795 const ID: u32 = 332u32;
30796 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30797 const EXTRA_CRC: u8 = 236u8;
30798 const ENCODED_LEN: usize = 239usize;
30799 fn deser(
30800 _version: MavlinkVersion,
30801 __input: &[u8],
30802 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30803 let avail_len = __input.len();
30804 let mut payload_buf = [0; Self::ENCODED_LEN];
30805 let mut buf = if avail_len < Self::ENCODED_LEN {
30806 payload_buf[0..avail_len].copy_from_slice(__input);
30807 Bytes::new(&payload_buf)
30808 } else {
30809 Bytes::new(__input)
30810 };
30811 let mut __struct = Self::default();
30812 __struct.time_usec = buf.get_u64_le();
30813 for v in &mut __struct.pos_x {
30814 let val = buf.get_f32_le();
30815 *v = val;
30816 }
30817 for v in &mut __struct.pos_y {
30818 let val = buf.get_f32_le();
30819 *v = val;
30820 }
30821 for v in &mut __struct.pos_z {
30822 let val = buf.get_f32_le();
30823 *v = val;
30824 }
30825 for v in &mut __struct.vel_x {
30826 let val = buf.get_f32_le();
30827 *v = val;
30828 }
30829 for v in &mut __struct.vel_y {
30830 let val = buf.get_f32_le();
30831 *v = val;
30832 }
30833 for v in &mut __struct.vel_z {
30834 let val = buf.get_f32_le();
30835 *v = val;
30836 }
30837 for v in &mut __struct.acc_x {
30838 let val = buf.get_f32_le();
30839 *v = val;
30840 }
30841 for v in &mut __struct.acc_y {
30842 let val = buf.get_f32_le();
30843 *v = val;
30844 }
30845 for v in &mut __struct.acc_z {
30846 let val = buf.get_f32_le();
30847 *v = val;
30848 }
30849 for v in &mut __struct.pos_yaw {
30850 let val = buf.get_f32_le();
30851 *v = val;
30852 }
30853 for v in &mut __struct.vel_yaw {
30854 let val = buf.get_f32_le();
30855 *v = val;
30856 }
30857 for v in &mut __struct.command {
30858 let val = buf.get_u16_le();
30859 *v = val;
30860 }
30861 __struct.valid_points = buf.get_u8();
30862 Ok(__struct)
30863 }
30864 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30865 let mut __tmp = BytesMut::new(bytes);
30866 #[allow(clippy::absurd_extreme_comparisons)]
30867 #[allow(unused_comparisons)]
30868 if __tmp.remaining() < Self::ENCODED_LEN {
30869 panic!(
30870 "buffer is too small (need {} bytes, but got {})",
30871 Self::ENCODED_LEN,
30872 __tmp.remaining(),
30873 )
30874 }
30875 __tmp.put_u64_le(self.time_usec);
30876 for val in &self.pos_x {
30877 __tmp.put_f32_le(*val);
30878 }
30879 for val in &self.pos_y {
30880 __tmp.put_f32_le(*val);
30881 }
30882 for val in &self.pos_z {
30883 __tmp.put_f32_le(*val);
30884 }
30885 for val in &self.vel_x {
30886 __tmp.put_f32_le(*val);
30887 }
30888 for val in &self.vel_y {
30889 __tmp.put_f32_le(*val);
30890 }
30891 for val in &self.vel_z {
30892 __tmp.put_f32_le(*val);
30893 }
30894 for val in &self.acc_x {
30895 __tmp.put_f32_le(*val);
30896 }
30897 for val in &self.acc_y {
30898 __tmp.put_f32_le(*val);
30899 }
30900 for val in &self.acc_z {
30901 __tmp.put_f32_le(*val);
30902 }
30903 for val in &self.pos_yaw {
30904 __tmp.put_f32_le(*val);
30905 }
30906 for val in &self.vel_yaw {
30907 __tmp.put_f32_le(*val);
30908 }
30909 for val in &self.command {
30910 __tmp.put_u16_le(*val);
30911 }
30912 __tmp.put_u8(self.valid_points);
30913 if matches!(version, MavlinkVersion::V2) {
30914 let len = __tmp.len();
30915 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30916 } else {
30917 __tmp.len()
30918 }
30919 }
30920}
30921#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30922#[doc = ""]
30923#[doc = "ID: 385"]
30924#[derive(Debug, Clone, PartialEq)]
30925#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30926#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30927#[cfg_attr(feature = "ts", derive(TS))]
30928#[cfg_attr(feature = "ts", ts(export))]
30929pub struct TUNNEL_DATA {
30930 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30931 pub payload_type: MavTunnelPayloadType,
30932 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30933 pub target_system: u8,
30934 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30935 pub target_component: u8,
30936 #[doc = "Length of the data transported in payload"]
30937 pub payload_length: u8,
30938 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30939 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30940 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30941 pub payload: [u8; 128],
30942}
30943impl TUNNEL_DATA {
30944 pub const ENCODED_LEN: usize = 133usize;
30945 pub const DEFAULT: Self = Self {
30946 payload_type: MavTunnelPayloadType::DEFAULT,
30947 target_system: 0_u8,
30948 target_component: 0_u8,
30949 payload_length: 0_u8,
30950 payload: [0_u8; 128usize],
30951 };
30952 #[cfg(feature = "arbitrary")]
30953 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30954 use arbitrary::{Arbitrary, Unstructured};
30955 let mut buf = [0u8; 1024];
30956 rng.fill_bytes(&mut buf);
30957 let mut unstructured = Unstructured::new(&buf);
30958 Self::arbitrary(&mut unstructured).unwrap_or_default()
30959 }
30960}
30961impl Default for TUNNEL_DATA {
30962 fn default() -> Self {
30963 Self::DEFAULT.clone()
30964 }
30965}
30966impl MessageData for TUNNEL_DATA {
30967 type Message = MavMessage;
30968 const ID: u32 = 385u32;
30969 const NAME: &'static str = "TUNNEL";
30970 const EXTRA_CRC: u8 = 147u8;
30971 const ENCODED_LEN: usize = 133usize;
30972 fn deser(
30973 _version: MavlinkVersion,
30974 __input: &[u8],
30975 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30976 let avail_len = __input.len();
30977 let mut payload_buf = [0; Self::ENCODED_LEN];
30978 let mut buf = if avail_len < Self::ENCODED_LEN {
30979 payload_buf[0..avail_len].copy_from_slice(__input);
30980 Bytes::new(&payload_buf)
30981 } else {
30982 Bytes::new(__input)
30983 };
30984 let mut __struct = Self::default();
30985 let tmp = buf.get_u16_le();
30986 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30987 ::mavlink_core::error::ParserError::InvalidEnum {
30988 enum_type: "MavTunnelPayloadType",
30989 value: tmp as u32,
30990 },
30991 )?;
30992 __struct.target_system = buf.get_u8();
30993 __struct.target_component = buf.get_u8();
30994 __struct.payload_length = buf.get_u8();
30995 for v in &mut __struct.payload {
30996 let val = buf.get_u8();
30997 *v = val;
30998 }
30999 Ok(__struct)
31000 }
31001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31002 let mut __tmp = BytesMut::new(bytes);
31003 #[allow(clippy::absurd_extreme_comparisons)]
31004 #[allow(unused_comparisons)]
31005 if __tmp.remaining() < Self::ENCODED_LEN {
31006 panic!(
31007 "buffer is too small (need {} bytes, but got {})",
31008 Self::ENCODED_LEN,
31009 __tmp.remaining(),
31010 )
31011 }
31012 __tmp.put_u16_le(self.payload_type as u16);
31013 __tmp.put_u8(self.target_system);
31014 __tmp.put_u8(self.target_component);
31015 __tmp.put_u8(self.payload_length);
31016 for val in &self.payload {
31017 __tmp.put_u8(*val);
31018 }
31019 if matches!(version, MavlinkVersion::V2) {
31020 let len = __tmp.len();
31021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31022 } else {
31023 __tmp.len()
31024 }
31025 }
31026}
31027#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
31028#[doc = ""]
31029#[doc = "ID: 311"]
31030#[derive(Debug, Clone, PartialEq)]
31031#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31033#[cfg_attr(feature = "ts", derive(TS))]
31034#[cfg_attr(feature = "ts", ts(export))]
31035pub struct UAVCAN_NODE_INFO_DATA {
31036 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31037 pub time_usec: u64,
31038 #[doc = "Time since the start-up of the node."]
31039 pub uptime_sec: u32,
31040 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
31041 pub sw_vcs_commit: u32,
31042 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
31043 #[cfg_attr(
31044 feature = "serde",
31045 serde(
31046 serialize_with = "crate::nulstr::serialize::<_, 80>",
31047 deserialize_with = "crate::nulstr::deserialize::<_, 80>"
31048 )
31049 )]
31050 #[cfg_attr(feature = "ts", ts(type = "string"))]
31051 pub name: [u8; 80],
31052 #[doc = "Hardware major version number."]
31053 pub hw_version_major: u8,
31054 #[doc = "Hardware minor version number."]
31055 pub hw_version_minor: u8,
31056 #[doc = "Hardware unique 128-bit ID."]
31057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31058 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31059 pub hw_unique_id: [u8; 16],
31060 #[doc = "Software major version number."]
31061 pub sw_version_major: u8,
31062 #[doc = "Software minor version number."]
31063 pub sw_version_minor: u8,
31064}
31065impl UAVCAN_NODE_INFO_DATA {
31066 pub const ENCODED_LEN: usize = 116usize;
31067 pub const DEFAULT: Self = Self {
31068 time_usec: 0_u64,
31069 uptime_sec: 0_u32,
31070 sw_vcs_commit: 0_u32,
31071 name: [0_u8; 80usize],
31072 hw_version_major: 0_u8,
31073 hw_version_minor: 0_u8,
31074 hw_unique_id: [0_u8; 16usize],
31075 sw_version_major: 0_u8,
31076 sw_version_minor: 0_u8,
31077 };
31078 #[cfg(feature = "arbitrary")]
31079 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31080 use arbitrary::{Arbitrary, Unstructured};
31081 let mut buf = [0u8; 1024];
31082 rng.fill_bytes(&mut buf);
31083 let mut unstructured = Unstructured::new(&buf);
31084 Self::arbitrary(&mut unstructured).unwrap_or_default()
31085 }
31086}
31087impl Default for UAVCAN_NODE_INFO_DATA {
31088 fn default() -> Self {
31089 Self::DEFAULT.clone()
31090 }
31091}
31092impl MessageData for UAVCAN_NODE_INFO_DATA {
31093 type Message = MavMessage;
31094 const ID: u32 = 311u32;
31095 const NAME: &'static str = "UAVCAN_NODE_INFO";
31096 const EXTRA_CRC: u8 = 95u8;
31097 const ENCODED_LEN: usize = 116usize;
31098 fn deser(
31099 _version: MavlinkVersion,
31100 __input: &[u8],
31101 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31102 let avail_len = __input.len();
31103 let mut payload_buf = [0; Self::ENCODED_LEN];
31104 let mut buf = if avail_len < Self::ENCODED_LEN {
31105 payload_buf[0..avail_len].copy_from_slice(__input);
31106 Bytes::new(&payload_buf)
31107 } else {
31108 Bytes::new(__input)
31109 };
31110 let mut __struct = Self::default();
31111 __struct.time_usec = buf.get_u64_le();
31112 __struct.uptime_sec = buf.get_u32_le();
31113 __struct.sw_vcs_commit = buf.get_u32_le();
31114 for v in &mut __struct.name {
31115 let val = buf.get_u8();
31116 *v = val;
31117 }
31118 __struct.hw_version_major = buf.get_u8();
31119 __struct.hw_version_minor = buf.get_u8();
31120 for v in &mut __struct.hw_unique_id {
31121 let val = buf.get_u8();
31122 *v = val;
31123 }
31124 __struct.sw_version_major = buf.get_u8();
31125 __struct.sw_version_minor = buf.get_u8();
31126 Ok(__struct)
31127 }
31128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31129 let mut __tmp = BytesMut::new(bytes);
31130 #[allow(clippy::absurd_extreme_comparisons)]
31131 #[allow(unused_comparisons)]
31132 if __tmp.remaining() < Self::ENCODED_LEN {
31133 panic!(
31134 "buffer is too small (need {} bytes, but got {})",
31135 Self::ENCODED_LEN,
31136 __tmp.remaining(),
31137 )
31138 }
31139 __tmp.put_u64_le(self.time_usec);
31140 __tmp.put_u32_le(self.uptime_sec);
31141 __tmp.put_u32_le(self.sw_vcs_commit);
31142 for val in &self.name {
31143 __tmp.put_u8(*val);
31144 }
31145 __tmp.put_u8(self.hw_version_major);
31146 __tmp.put_u8(self.hw_version_minor);
31147 for val in &self.hw_unique_id {
31148 __tmp.put_u8(*val);
31149 }
31150 __tmp.put_u8(self.sw_version_major);
31151 __tmp.put_u8(self.sw_version_minor);
31152 if matches!(version, MavlinkVersion::V2) {
31153 let len = __tmp.len();
31154 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31155 } else {
31156 __tmp.len()
31157 }
31158 }
31159}
31160#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
31161#[doc = ""]
31162#[doc = "ID: 310"]
31163#[derive(Debug, Clone, PartialEq)]
31164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31165#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31166#[cfg_attr(feature = "ts", derive(TS))]
31167#[cfg_attr(feature = "ts", ts(export))]
31168pub struct UAVCAN_NODE_STATUS_DATA {
31169 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31170 pub time_usec: u64,
31171 #[doc = "Time since the start-up of the node."]
31172 pub uptime_sec: u32,
31173 #[doc = "Vendor-specific status information."]
31174 pub vendor_specific_status_code: u16,
31175 #[doc = "Generalized node health status."]
31176 pub health: UavcanNodeHealth,
31177 #[doc = "Generalized operating mode."]
31178 pub mode: UavcanNodeMode,
31179 #[doc = "Not used currently."]
31180 pub sub_mode: u8,
31181}
31182impl UAVCAN_NODE_STATUS_DATA {
31183 pub const ENCODED_LEN: usize = 17usize;
31184 pub const DEFAULT: Self = Self {
31185 time_usec: 0_u64,
31186 uptime_sec: 0_u32,
31187 vendor_specific_status_code: 0_u16,
31188 health: UavcanNodeHealth::DEFAULT,
31189 mode: UavcanNodeMode::DEFAULT,
31190 sub_mode: 0_u8,
31191 };
31192 #[cfg(feature = "arbitrary")]
31193 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31194 use arbitrary::{Arbitrary, Unstructured};
31195 let mut buf = [0u8; 1024];
31196 rng.fill_bytes(&mut buf);
31197 let mut unstructured = Unstructured::new(&buf);
31198 Self::arbitrary(&mut unstructured).unwrap_or_default()
31199 }
31200}
31201impl Default for UAVCAN_NODE_STATUS_DATA {
31202 fn default() -> Self {
31203 Self::DEFAULT.clone()
31204 }
31205}
31206impl MessageData for UAVCAN_NODE_STATUS_DATA {
31207 type Message = MavMessage;
31208 const ID: u32 = 310u32;
31209 const NAME: &'static str = "UAVCAN_NODE_STATUS";
31210 const EXTRA_CRC: u8 = 28u8;
31211 const ENCODED_LEN: usize = 17usize;
31212 fn deser(
31213 _version: MavlinkVersion,
31214 __input: &[u8],
31215 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31216 let avail_len = __input.len();
31217 let mut payload_buf = [0; Self::ENCODED_LEN];
31218 let mut buf = if avail_len < Self::ENCODED_LEN {
31219 payload_buf[0..avail_len].copy_from_slice(__input);
31220 Bytes::new(&payload_buf)
31221 } else {
31222 Bytes::new(__input)
31223 };
31224 let mut __struct = Self::default();
31225 __struct.time_usec = buf.get_u64_le();
31226 __struct.uptime_sec = buf.get_u32_le();
31227 __struct.vendor_specific_status_code = buf.get_u16_le();
31228 let tmp = buf.get_u8();
31229 __struct.health =
31230 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31231 enum_type: "UavcanNodeHealth",
31232 value: tmp as u32,
31233 })?;
31234 let tmp = buf.get_u8();
31235 __struct.mode =
31236 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31237 enum_type: "UavcanNodeMode",
31238 value: tmp as u32,
31239 })?;
31240 __struct.sub_mode = buf.get_u8();
31241 Ok(__struct)
31242 }
31243 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31244 let mut __tmp = BytesMut::new(bytes);
31245 #[allow(clippy::absurd_extreme_comparisons)]
31246 #[allow(unused_comparisons)]
31247 if __tmp.remaining() < Self::ENCODED_LEN {
31248 panic!(
31249 "buffer is too small (need {} bytes, but got {})",
31250 Self::ENCODED_LEN,
31251 __tmp.remaining(),
31252 )
31253 }
31254 __tmp.put_u64_le(self.time_usec);
31255 __tmp.put_u32_le(self.uptime_sec);
31256 __tmp.put_u16_le(self.vendor_specific_status_code);
31257 __tmp.put_u8(self.health as u8);
31258 __tmp.put_u8(self.mode as u8);
31259 __tmp.put_u8(self.sub_mode);
31260 if matches!(version, MavlinkVersion::V2) {
31261 let len = __tmp.len();
31262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31263 } else {
31264 __tmp.len()
31265 }
31266 }
31267}
31268#[doc = "The global position resulting from GPS and sensor fusion."]
31269#[doc = ""]
31270#[doc = "ID: 340"]
31271#[derive(Debug, Clone, PartialEq)]
31272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31274#[cfg_attr(feature = "ts", derive(TS))]
31275#[cfg_attr(feature = "ts", ts(export))]
31276pub struct UTM_GLOBAL_POSITION_DATA {
31277 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
31278 pub time: u64,
31279 #[doc = "Latitude (WGS84)"]
31280 pub lat: i32,
31281 #[doc = "Longitude (WGS84)"]
31282 pub lon: i32,
31283 #[doc = "Altitude (WGS84)"]
31284 pub alt: i32,
31285 #[doc = "Altitude above ground"]
31286 pub relative_alt: i32,
31287 #[doc = "Next waypoint, latitude (WGS84)"]
31288 pub next_lat: i32,
31289 #[doc = "Next waypoint, longitude (WGS84)"]
31290 pub next_lon: i32,
31291 #[doc = "Next waypoint, altitude (WGS84)"]
31292 pub next_alt: i32,
31293 #[doc = "Ground X speed (latitude, positive north)"]
31294 pub vx: i16,
31295 #[doc = "Ground Y speed (longitude, positive east)"]
31296 pub vy: i16,
31297 #[doc = "Ground Z speed (altitude, positive down)"]
31298 pub vz: i16,
31299 #[doc = "Horizontal position uncertainty (standard deviation)"]
31300 pub h_acc: u16,
31301 #[doc = "Altitude uncertainty (standard deviation)"]
31302 pub v_acc: u16,
31303 #[doc = "Speed uncertainty (standard deviation)"]
31304 pub vel_acc: u16,
31305 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
31306 pub update_rate: u16,
31307 #[doc = "Unique UAS ID."]
31308 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31309 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31310 pub uas_id: [u8; 18],
31311 #[doc = "Flight state"]
31312 pub flight_state: UtmFlightState,
31313 #[doc = "Bitwise OR combination of the data available flags."]
31314 pub flags: UtmDataAvailFlags,
31315}
31316impl UTM_GLOBAL_POSITION_DATA {
31317 pub const ENCODED_LEN: usize = 70usize;
31318 pub const DEFAULT: Self = Self {
31319 time: 0_u64,
31320 lat: 0_i32,
31321 lon: 0_i32,
31322 alt: 0_i32,
31323 relative_alt: 0_i32,
31324 next_lat: 0_i32,
31325 next_lon: 0_i32,
31326 next_alt: 0_i32,
31327 vx: 0_i16,
31328 vy: 0_i16,
31329 vz: 0_i16,
31330 h_acc: 0_u16,
31331 v_acc: 0_u16,
31332 vel_acc: 0_u16,
31333 update_rate: 0_u16,
31334 uas_id: [0_u8; 18usize],
31335 flight_state: UtmFlightState::DEFAULT,
31336 flags: UtmDataAvailFlags::DEFAULT,
31337 };
31338 #[cfg(feature = "arbitrary")]
31339 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31340 use arbitrary::{Arbitrary, Unstructured};
31341 let mut buf = [0u8; 1024];
31342 rng.fill_bytes(&mut buf);
31343 let mut unstructured = Unstructured::new(&buf);
31344 Self::arbitrary(&mut unstructured).unwrap_or_default()
31345 }
31346}
31347impl Default for UTM_GLOBAL_POSITION_DATA {
31348 fn default() -> Self {
31349 Self::DEFAULT.clone()
31350 }
31351}
31352impl MessageData for UTM_GLOBAL_POSITION_DATA {
31353 type Message = MavMessage;
31354 const ID: u32 = 340u32;
31355 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31356 const EXTRA_CRC: u8 = 99u8;
31357 const ENCODED_LEN: usize = 70usize;
31358 fn deser(
31359 _version: MavlinkVersion,
31360 __input: &[u8],
31361 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31362 let avail_len = __input.len();
31363 let mut payload_buf = [0; Self::ENCODED_LEN];
31364 let mut buf = if avail_len < Self::ENCODED_LEN {
31365 payload_buf[0..avail_len].copy_from_slice(__input);
31366 Bytes::new(&payload_buf)
31367 } else {
31368 Bytes::new(__input)
31369 };
31370 let mut __struct = Self::default();
31371 __struct.time = buf.get_u64_le();
31372 __struct.lat = buf.get_i32_le();
31373 __struct.lon = buf.get_i32_le();
31374 __struct.alt = buf.get_i32_le();
31375 __struct.relative_alt = buf.get_i32_le();
31376 __struct.next_lat = buf.get_i32_le();
31377 __struct.next_lon = buf.get_i32_le();
31378 __struct.next_alt = buf.get_i32_le();
31379 __struct.vx = buf.get_i16_le();
31380 __struct.vy = buf.get_i16_le();
31381 __struct.vz = buf.get_i16_le();
31382 __struct.h_acc = buf.get_u16_le();
31383 __struct.v_acc = buf.get_u16_le();
31384 __struct.vel_acc = buf.get_u16_le();
31385 __struct.update_rate = buf.get_u16_le();
31386 for v in &mut __struct.uas_id {
31387 let val = buf.get_u8();
31388 *v = val;
31389 }
31390 let tmp = buf.get_u8();
31391 __struct.flight_state =
31392 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31393 enum_type: "UtmFlightState",
31394 value: tmp as u32,
31395 })?;
31396 let tmp = buf.get_u8();
31397 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
31398 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31399 flag_type: "UtmDataAvailFlags",
31400 value: tmp as u32,
31401 })?;
31402 Ok(__struct)
31403 }
31404 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31405 let mut __tmp = BytesMut::new(bytes);
31406 #[allow(clippy::absurd_extreme_comparisons)]
31407 #[allow(unused_comparisons)]
31408 if __tmp.remaining() < Self::ENCODED_LEN {
31409 panic!(
31410 "buffer is too small (need {} bytes, but got {})",
31411 Self::ENCODED_LEN,
31412 __tmp.remaining(),
31413 )
31414 }
31415 __tmp.put_u64_le(self.time);
31416 __tmp.put_i32_le(self.lat);
31417 __tmp.put_i32_le(self.lon);
31418 __tmp.put_i32_le(self.alt);
31419 __tmp.put_i32_le(self.relative_alt);
31420 __tmp.put_i32_le(self.next_lat);
31421 __tmp.put_i32_le(self.next_lon);
31422 __tmp.put_i32_le(self.next_alt);
31423 __tmp.put_i16_le(self.vx);
31424 __tmp.put_i16_le(self.vy);
31425 __tmp.put_i16_le(self.vz);
31426 __tmp.put_u16_le(self.h_acc);
31427 __tmp.put_u16_le(self.v_acc);
31428 __tmp.put_u16_le(self.vel_acc);
31429 __tmp.put_u16_le(self.update_rate);
31430 for val in &self.uas_id {
31431 __tmp.put_u8(*val);
31432 }
31433 __tmp.put_u8(self.flight_state as u8);
31434 __tmp.put_u8(self.flags.bits());
31435 if matches!(version, MavlinkVersion::V2) {
31436 let len = __tmp.len();
31437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31438 } else {
31439 __tmp.len()
31440 }
31441 }
31442}
31443#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31444#[doc = ""]
31445#[doc = "ID: 248"]
31446#[derive(Debug, Clone, PartialEq)]
31447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31449#[cfg_attr(feature = "ts", derive(TS))]
31450#[cfg_attr(feature = "ts", ts(export))]
31451pub struct V2_EXTENSION_DATA {
31452 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31453 pub message_type: u16,
31454 #[doc = "Network ID (0 for broadcast)"]
31455 pub target_network: u8,
31456 #[doc = "System ID (0 for broadcast)"]
31457 pub target_system: u8,
31458 #[doc = "Component ID (0 for broadcast)"]
31459 pub target_component: u8,
31460 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31461 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31462 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31463 pub payload: [u8; 249],
31464}
31465impl V2_EXTENSION_DATA {
31466 pub const ENCODED_LEN: usize = 254usize;
31467 pub const DEFAULT: Self = Self {
31468 message_type: 0_u16,
31469 target_network: 0_u8,
31470 target_system: 0_u8,
31471 target_component: 0_u8,
31472 payload: [0_u8; 249usize],
31473 };
31474 #[cfg(feature = "arbitrary")]
31475 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31476 use arbitrary::{Arbitrary, Unstructured};
31477 let mut buf = [0u8; 1024];
31478 rng.fill_bytes(&mut buf);
31479 let mut unstructured = Unstructured::new(&buf);
31480 Self::arbitrary(&mut unstructured).unwrap_or_default()
31481 }
31482}
31483impl Default for V2_EXTENSION_DATA {
31484 fn default() -> Self {
31485 Self::DEFAULT.clone()
31486 }
31487}
31488impl MessageData for V2_EXTENSION_DATA {
31489 type Message = MavMessage;
31490 const ID: u32 = 248u32;
31491 const NAME: &'static str = "V2_EXTENSION";
31492 const EXTRA_CRC: u8 = 8u8;
31493 const ENCODED_LEN: usize = 254usize;
31494 fn deser(
31495 _version: MavlinkVersion,
31496 __input: &[u8],
31497 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31498 let avail_len = __input.len();
31499 let mut payload_buf = [0; Self::ENCODED_LEN];
31500 let mut buf = if avail_len < Self::ENCODED_LEN {
31501 payload_buf[0..avail_len].copy_from_slice(__input);
31502 Bytes::new(&payload_buf)
31503 } else {
31504 Bytes::new(__input)
31505 };
31506 let mut __struct = Self::default();
31507 __struct.message_type = buf.get_u16_le();
31508 __struct.target_network = buf.get_u8();
31509 __struct.target_system = buf.get_u8();
31510 __struct.target_component = buf.get_u8();
31511 for v in &mut __struct.payload {
31512 let val = buf.get_u8();
31513 *v = val;
31514 }
31515 Ok(__struct)
31516 }
31517 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31518 let mut __tmp = BytesMut::new(bytes);
31519 #[allow(clippy::absurd_extreme_comparisons)]
31520 #[allow(unused_comparisons)]
31521 if __tmp.remaining() < Self::ENCODED_LEN {
31522 panic!(
31523 "buffer is too small (need {} bytes, but got {})",
31524 Self::ENCODED_LEN,
31525 __tmp.remaining(),
31526 )
31527 }
31528 __tmp.put_u16_le(self.message_type);
31529 __tmp.put_u8(self.target_network);
31530 __tmp.put_u8(self.target_system);
31531 __tmp.put_u8(self.target_component);
31532 for val in &self.payload {
31533 __tmp.put_u8(*val);
31534 }
31535 if matches!(version, MavlinkVersion::V2) {
31536 let len = __tmp.len();
31537 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31538 } else {
31539 __tmp.len()
31540 }
31541 }
31542}
31543#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31544#[doc = ""]
31545#[doc = "ID: 74"]
31546#[derive(Debug, Clone, PartialEq)]
31547#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31549#[cfg_attr(feature = "ts", derive(TS))]
31550#[cfg_attr(feature = "ts", ts(export))]
31551pub struct VFR_HUD_DATA {
31552 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31553 pub airspeed: f32,
31554 #[doc = "Current ground speed."]
31555 pub groundspeed: f32,
31556 #[doc = "Current altitude (MSL)."]
31557 pub alt: f32,
31558 #[doc = "Current climb rate."]
31559 pub climb: f32,
31560 #[doc = "Current heading in compass units (0-360, 0=north)."]
31561 pub heading: i16,
31562 #[doc = "Current throttle setting (0 to 100)."]
31563 pub throttle: u16,
31564}
31565impl VFR_HUD_DATA {
31566 pub const ENCODED_LEN: usize = 20usize;
31567 pub const DEFAULT: Self = Self {
31568 airspeed: 0.0_f32,
31569 groundspeed: 0.0_f32,
31570 alt: 0.0_f32,
31571 climb: 0.0_f32,
31572 heading: 0_i16,
31573 throttle: 0_u16,
31574 };
31575 #[cfg(feature = "arbitrary")]
31576 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31577 use arbitrary::{Arbitrary, Unstructured};
31578 let mut buf = [0u8; 1024];
31579 rng.fill_bytes(&mut buf);
31580 let mut unstructured = Unstructured::new(&buf);
31581 Self::arbitrary(&mut unstructured).unwrap_or_default()
31582 }
31583}
31584impl Default for VFR_HUD_DATA {
31585 fn default() -> Self {
31586 Self::DEFAULT.clone()
31587 }
31588}
31589impl MessageData for VFR_HUD_DATA {
31590 type Message = MavMessage;
31591 const ID: u32 = 74u32;
31592 const NAME: &'static str = "VFR_HUD";
31593 const EXTRA_CRC: u8 = 20u8;
31594 const ENCODED_LEN: usize = 20usize;
31595 fn deser(
31596 _version: MavlinkVersion,
31597 __input: &[u8],
31598 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31599 let avail_len = __input.len();
31600 let mut payload_buf = [0; Self::ENCODED_LEN];
31601 let mut buf = if avail_len < Self::ENCODED_LEN {
31602 payload_buf[0..avail_len].copy_from_slice(__input);
31603 Bytes::new(&payload_buf)
31604 } else {
31605 Bytes::new(__input)
31606 };
31607 let mut __struct = Self::default();
31608 __struct.airspeed = buf.get_f32_le();
31609 __struct.groundspeed = buf.get_f32_le();
31610 __struct.alt = buf.get_f32_le();
31611 __struct.climb = buf.get_f32_le();
31612 __struct.heading = buf.get_i16_le();
31613 __struct.throttle = buf.get_u16_le();
31614 Ok(__struct)
31615 }
31616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31617 let mut __tmp = BytesMut::new(bytes);
31618 #[allow(clippy::absurd_extreme_comparisons)]
31619 #[allow(unused_comparisons)]
31620 if __tmp.remaining() < Self::ENCODED_LEN {
31621 panic!(
31622 "buffer is too small (need {} bytes, but got {})",
31623 Self::ENCODED_LEN,
31624 __tmp.remaining(),
31625 )
31626 }
31627 __tmp.put_f32_le(self.airspeed);
31628 __tmp.put_f32_le(self.groundspeed);
31629 __tmp.put_f32_le(self.alt);
31630 __tmp.put_f32_le(self.climb);
31631 __tmp.put_i16_le(self.heading);
31632 __tmp.put_u16_le(self.throttle);
31633 if matches!(version, MavlinkVersion::V2) {
31634 let len = __tmp.len();
31635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31636 } else {
31637 __tmp.len()
31638 }
31639 }
31640}
31641#[doc = "Vibration levels and accelerometer clipping."]
31642#[doc = ""]
31643#[doc = "ID: 241"]
31644#[derive(Debug, Clone, PartialEq)]
31645#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31646#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31647#[cfg_attr(feature = "ts", derive(TS))]
31648#[cfg_attr(feature = "ts", ts(export))]
31649pub struct VIBRATION_DATA {
31650 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31651 pub time_usec: u64,
31652 #[doc = "Vibration levels on X-axis"]
31653 pub vibration_x: f32,
31654 #[doc = "Vibration levels on Y-axis"]
31655 pub vibration_y: f32,
31656 #[doc = "Vibration levels on Z-axis"]
31657 pub vibration_z: f32,
31658 #[doc = "first accelerometer clipping count"]
31659 pub clipping_0: u32,
31660 #[doc = "second accelerometer clipping count"]
31661 pub clipping_1: u32,
31662 #[doc = "third accelerometer clipping count"]
31663 pub clipping_2: u32,
31664}
31665impl VIBRATION_DATA {
31666 pub const ENCODED_LEN: usize = 32usize;
31667 pub const DEFAULT: Self = Self {
31668 time_usec: 0_u64,
31669 vibration_x: 0.0_f32,
31670 vibration_y: 0.0_f32,
31671 vibration_z: 0.0_f32,
31672 clipping_0: 0_u32,
31673 clipping_1: 0_u32,
31674 clipping_2: 0_u32,
31675 };
31676 #[cfg(feature = "arbitrary")]
31677 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31678 use arbitrary::{Arbitrary, Unstructured};
31679 let mut buf = [0u8; 1024];
31680 rng.fill_bytes(&mut buf);
31681 let mut unstructured = Unstructured::new(&buf);
31682 Self::arbitrary(&mut unstructured).unwrap_or_default()
31683 }
31684}
31685impl Default for VIBRATION_DATA {
31686 fn default() -> Self {
31687 Self::DEFAULT.clone()
31688 }
31689}
31690impl MessageData for VIBRATION_DATA {
31691 type Message = MavMessage;
31692 const ID: u32 = 241u32;
31693 const NAME: &'static str = "VIBRATION";
31694 const EXTRA_CRC: u8 = 90u8;
31695 const ENCODED_LEN: usize = 32usize;
31696 fn deser(
31697 _version: MavlinkVersion,
31698 __input: &[u8],
31699 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31700 let avail_len = __input.len();
31701 let mut payload_buf = [0; Self::ENCODED_LEN];
31702 let mut buf = if avail_len < Self::ENCODED_LEN {
31703 payload_buf[0..avail_len].copy_from_slice(__input);
31704 Bytes::new(&payload_buf)
31705 } else {
31706 Bytes::new(__input)
31707 };
31708 let mut __struct = Self::default();
31709 __struct.time_usec = buf.get_u64_le();
31710 __struct.vibration_x = buf.get_f32_le();
31711 __struct.vibration_y = buf.get_f32_le();
31712 __struct.vibration_z = buf.get_f32_le();
31713 __struct.clipping_0 = buf.get_u32_le();
31714 __struct.clipping_1 = buf.get_u32_le();
31715 __struct.clipping_2 = buf.get_u32_le();
31716 Ok(__struct)
31717 }
31718 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31719 let mut __tmp = BytesMut::new(bytes);
31720 #[allow(clippy::absurd_extreme_comparisons)]
31721 #[allow(unused_comparisons)]
31722 if __tmp.remaining() < Self::ENCODED_LEN {
31723 panic!(
31724 "buffer is too small (need {} bytes, but got {})",
31725 Self::ENCODED_LEN,
31726 __tmp.remaining(),
31727 )
31728 }
31729 __tmp.put_u64_le(self.time_usec);
31730 __tmp.put_f32_le(self.vibration_x);
31731 __tmp.put_f32_le(self.vibration_y);
31732 __tmp.put_f32_le(self.vibration_z);
31733 __tmp.put_u32_le(self.clipping_0);
31734 __tmp.put_u32_le(self.clipping_1);
31735 __tmp.put_u32_le(self.clipping_2);
31736 if matches!(version, MavlinkVersion::V2) {
31737 let len = __tmp.len();
31738 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31739 } else {
31740 __tmp.len()
31741 }
31742 }
31743}
31744#[doc = "Global position estimate from a Vicon motion system source."]
31745#[doc = ""]
31746#[doc = "ID: 104"]
31747#[derive(Debug, Clone, PartialEq)]
31748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31750#[cfg_attr(feature = "ts", derive(TS))]
31751#[cfg_attr(feature = "ts", ts(export))]
31752pub struct VICON_POSITION_ESTIMATE_DATA {
31753 #[doc = "Timestamp (UNIX time or time since system boot)"]
31754 pub usec: u64,
31755 #[doc = "Global X position"]
31756 pub x: f32,
31757 #[doc = "Global Y position"]
31758 pub y: f32,
31759 #[doc = "Global Z position"]
31760 pub z: f32,
31761 #[doc = "Roll angle"]
31762 pub roll: f32,
31763 #[doc = "Pitch angle"]
31764 pub pitch: f32,
31765 #[doc = "Yaw angle"]
31766 pub yaw: f32,
31767 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31768 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31769 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31770 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31771 pub covariance: [f32; 21],
31772}
31773impl VICON_POSITION_ESTIMATE_DATA {
31774 pub const ENCODED_LEN: usize = 116usize;
31775 pub const DEFAULT: Self = Self {
31776 usec: 0_u64,
31777 x: 0.0_f32,
31778 y: 0.0_f32,
31779 z: 0.0_f32,
31780 roll: 0.0_f32,
31781 pitch: 0.0_f32,
31782 yaw: 0.0_f32,
31783 covariance: [0.0_f32; 21usize],
31784 };
31785 #[cfg(feature = "arbitrary")]
31786 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31787 use arbitrary::{Arbitrary, Unstructured};
31788 let mut buf = [0u8; 1024];
31789 rng.fill_bytes(&mut buf);
31790 let mut unstructured = Unstructured::new(&buf);
31791 Self::arbitrary(&mut unstructured).unwrap_or_default()
31792 }
31793}
31794impl Default for VICON_POSITION_ESTIMATE_DATA {
31795 fn default() -> Self {
31796 Self::DEFAULT.clone()
31797 }
31798}
31799impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31800 type Message = MavMessage;
31801 const ID: u32 = 104u32;
31802 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31803 const EXTRA_CRC: u8 = 56u8;
31804 const ENCODED_LEN: usize = 116usize;
31805 fn deser(
31806 _version: MavlinkVersion,
31807 __input: &[u8],
31808 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31809 let avail_len = __input.len();
31810 let mut payload_buf = [0; Self::ENCODED_LEN];
31811 let mut buf = if avail_len < Self::ENCODED_LEN {
31812 payload_buf[0..avail_len].copy_from_slice(__input);
31813 Bytes::new(&payload_buf)
31814 } else {
31815 Bytes::new(__input)
31816 };
31817 let mut __struct = Self::default();
31818 __struct.usec = buf.get_u64_le();
31819 __struct.x = buf.get_f32_le();
31820 __struct.y = buf.get_f32_le();
31821 __struct.z = buf.get_f32_le();
31822 __struct.roll = buf.get_f32_le();
31823 __struct.pitch = buf.get_f32_le();
31824 __struct.yaw = buf.get_f32_le();
31825 for v in &mut __struct.covariance {
31826 let val = buf.get_f32_le();
31827 *v = val;
31828 }
31829 Ok(__struct)
31830 }
31831 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31832 let mut __tmp = BytesMut::new(bytes);
31833 #[allow(clippy::absurd_extreme_comparisons)]
31834 #[allow(unused_comparisons)]
31835 if __tmp.remaining() < Self::ENCODED_LEN {
31836 panic!(
31837 "buffer is too small (need {} bytes, but got {})",
31838 Self::ENCODED_LEN,
31839 __tmp.remaining(),
31840 )
31841 }
31842 __tmp.put_u64_le(self.usec);
31843 __tmp.put_f32_le(self.x);
31844 __tmp.put_f32_le(self.y);
31845 __tmp.put_f32_le(self.z);
31846 __tmp.put_f32_le(self.roll);
31847 __tmp.put_f32_le(self.pitch);
31848 __tmp.put_f32_le(self.yaw);
31849 if matches!(version, MavlinkVersion::V2) {
31850 for val in &self.covariance {
31851 __tmp.put_f32_le(*val);
31852 }
31853 let len = __tmp.len();
31854 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31855 } else {
31856 __tmp.len()
31857 }
31858 }
31859}
31860#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31861#[doc = ""]
31862#[doc = "ID: 269"]
31863#[derive(Debug, Clone, PartialEq)]
31864#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31866#[cfg_attr(feature = "ts", derive(TS))]
31867#[cfg_attr(feature = "ts", ts(export))]
31868pub struct VIDEO_STREAM_INFORMATION_DATA {
31869 #[doc = "Frame rate."]
31870 pub framerate: f32,
31871 #[doc = "Bit rate."]
31872 pub bitrate: u32,
31873 #[doc = "Bitmap of stream status flags."]
31874 pub flags: VideoStreamStatusFlags,
31875 #[doc = "Horizontal resolution."]
31876 pub resolution_h: u16,
31877 #[doc = "Vertical resolution."]
31878 pub resolution_v: u16,
31879 #[doc = "Video image rotation clockwise."]
31880 pub rotation: u16,
31881 #[doc = "Horizontal Field of view."]
31882 pub hfov: u16,
31883 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31884 pub stream_id: u8,
31885 #[doc = "Number of streams available."]
31886 pub count: u8,
31887 #[doc = "Type of stream."]
31888 pub mavtype: VideoStreamType,
31889 #[doc = "Stream name."]
31890 #[cfg_attr(
31891 feature = "serde",
31892 serde(
31893 serialize_with = "crate::nulstr::serialize::<_, 32>",
31894 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
31895 )
31896 )]
31897 #[cfg_attr(feature = "ts", ts(type = "string"))]
31898 pub name: [u8; 32],
31899 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31900 #[cfg_attr(
31901 feature = "serde",
31902 serde(
31903 serialize_with = "crate::nulstr::serialize::<_, 160>",
31904 deserialize_with = "crate::nulstr::deserialize::<_, 160>"
31905 )
31906 )]
31907 #[cfg_attr(feature = "ts", ts(type = "string"))]
31908 pub uri: [u8; 160],
31909 #[doc = "Encoding of stream."]
31910 #[cfg_attr(feature = "serde", serde(default))]
31911 pub encoding: VideoStreamEncoding,
31912 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31913 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31914 pub camera_device_id: u8,
31915}
31916impl VIDEO_STREAM_INFORMATION_DATA {
31917 pub const ENCODED_LEN: usize = 215usize;
31918 pub const DEFAULT: Self = Self {
31919 framerate: 0.0_f32,
31920 bitrate: 0_u32,
31921 flags: VideoStreamStatusFlags::DEFAULT,
31922 resolution_h: 0_u16,
31923 resolution_v: 0_u16,
31924 rotation: 0_u16,
31925 hfov: 0_u16,
31926 stream_id: 0_u8,
31927 count: 0_u8,
31928 mavtype: VideoStreamType::DEFAULT,
31929 name: [0_u8; 32usize],
31930 uri: [0_u8; 160usize],
31931 encoding: VideoStreamEncoding::DEFAULT,
31932 camera_device_id: 0_u8,
31933 };
31934 #[cfg(feature = "arbitrary")]
31935 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31936 use arbitrary::{Arbitrary, Unstructured};
31937 let mut buf = [0u8; 1024];
31938 rng.fill_bytes(&mut buf);
31939 let mut unstructured = Unstructured::new(&buf);
31940 Self::arbitrary(&mut unstructured).unwrap_or_default()
31941 }
31942}
31943impl Default for VIDEO_STREAM_INFORMATION_DATA {
31944 fn default() -> Self {
31945 Self::DEFAULT.clone()
31946 }
31947}
31948impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31949 type Message = MavMessage;
31950 const ID: u32 = 269u32;
31951 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31952 const EXTRA_CRC: u8 = 109u8;
31953 const ENCODED_LEN: usize = 215usize;
31954 fn deser(
31955 _version: MavlinkVersion,
31956 __input: &[u8],
31957 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31958 let avail_len = __input.len();
31959 let mut payload_buf = [0; Self::ENCODED_LEN];
31960 let mut buf = if avail_len < Self::ENCODED_LEN {
31961 payload_buf[0..avail_len].copy_from_slice(__input);
31962 Bytes::new(&payload_buf)
31963 } else {
31964 Bytes::new(__input)
31965 };
31966 let mut __struct = Self::default();
31967 __struct.framerate = buf.get_f32_le();
31968 __struct.bitrate = buf.get_u32_le();
31969 let tmp = buf.get_u16_le();
31970 __struct.flags = VideoStreamStatusFlags::from_bits(
31971 tmp & VideoStreamStatusFlags::all().bits(),
31972 )
31973 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31974 flag_type: "VideoStreamStatusFlags",
31975 value: tmp as u32,
31976 })?;
31977 __struct.resolution_h = buf.get_u16_le();
31978 __struct.resolution_v = buf.get_u16_le();
31979 __struct.rotation = buf.get_u16_le();
31980 __struct.hfov = buf.get_u16_le();
31981 __struct.stream_id = buf.get_u8();
31982 __struct.count = buf.get_u8();
31983 let tmp = buf.get_u8();
31984 __struct.mavtype =
31985 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31986 enum_type: "VideoStreamType",
31987 value: tmp as u32,
31988 })?;
31989 for v in &mut __struct.name {
31990 let val = buf.get_u8();
31991 *v = val;
31992 }
31993 for v in &mut __struct.uri {
31994 let val = buf.get_u8();
31995 *v = val;
31996 }
31997 let tmp = buf.get_u8();
31998 __struct.encoding =
31999 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32000 enum_type: "VideoStreamEncoding",
32001 value: tmp as u32,
32002 })?;
32003 __struct.camera_device_id = buf.get_u8();
32004 Ok(__struct)
32005 }
32006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32007 let mut __tmp = BytesMut::new(bytes);
32008 #[allow(clippy::absurd_extreme_comparisons)]
32009 #[allow(unused_comparisons)]
32010 if __tmp.remaining() < Self::ENCODED_LEN {
32011 panic!(
32012 "buffer is too small (need {} bytes, but got {})",
32013 Self::ENCODED_LEN,
32014 __tmp.remaining(),
32015 )
32016 }
32017 __tmp.put_f32_le(self.framerate);
32018 __tmp.put_u32_le(self.bitrate);
32019 __tmp.put_u16_le(self.flags.bits());
32020 __tmp.put_u16_le(self.resolution_h);
32021 __tmp.put_u16_le(self.resolution_v);
32022 __tmp.put_u16_le(self.rotation);
32023 __tmp.put_u16_le(self.hfov);
32024 __tmp.put_u8(self.stream_id);
32025 __tmp.put_u8(self.count);
32026 __tmp.put_u8(self.mavtype as u8);
32027 for val in &self.name {
32028 __tmp.put_u8(*val);
32029 }
32030 for val in &self.uri {
32031 __tmp.put_u8(*val);
32032 }
32033 if matches!(version, MavlinkVersion::V2) {
32034 __tmp.put_u8(self.encoding as u8);
32035 __tmp.put_u8(self.camera_device_id);
32036 let len = __tmp.len();
32037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32038 } else {
32039 __tmp.len()
32040 }
32041 }
32042}
32043#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32044#[doc = ""]
32045#[doc = "ID: 270"]
32046#[derive(Debug, Clone, PartialEq)]
32047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32049#[cfg_attr(feature = "ts", derive(TS))]
32050#[cfg_attr(feature = "ts", ts(export))]
32051pub struct VIDEO_STREAM_STATUS_DATA {
32052 #[doc = "Frame rate"]
32053 pub framerate: f32,
32054 #[doc = "Bit rate"]
32055 pub bitrate: u32,
32056 #[doc = "Bitmap of stream status flags"]
32057 pub flags: VideoStreamStatusFlags,
32058 #[doc = "Horizontal resolution"]
32059 pub resolution_h: u16,
32060 #[doc = "Vertical resolution"]
32061 pub resolution_v: u16,
32062 #[doc = "Video image rotation clockwise"]
32063 pub rotation: u16,
32064 #[doc = "Horizontal Field of view"]
32065 pub hfov: u16,
32066 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32067 pub stream_id: u8,
32068 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32069 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32070 pub camera_device_id: u8,
32071}
32072impl VIDEO_STREAM_STATUS_DATA {
32073 pub const ENCODED_LEN: usize = 20usize;
32074 pub const DEFAULT: Self = Self {
32075 framerate: 0.0_f32,
32076 bitrate: 0_u32,
32077 flags: VideoStreamStatusFlags::DEFAULT,
32078 resolution_h: 0_u16,
32079 resolution_v: 0_u16,
32080 rotation: 0_u16,
32081 hfov: 0_u16,
32082 stream_id: 0_u8,
32083 camera_device_id: 0_u8,
32084 };
32085 #[cfg(feature = "arbitrary")]
32086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32087 use arbitrary::{Arbitrary, Unstructured};
32088 let mut buf = [0u8; 1024];
32089 rng.fill_bytes(&mut buf);
32090 let mut unstructured = Unstructured::new(&buf);
32091 Self::arbitrary(&mut unstructured).unwrap_or_default()
32092 }
32093}
32094impl Default for VIDEO_STREAM_STATUS_DATA {
32095 fn default() -> Self {
32096 Self::DEFAULT.clone()
32097 }
32098}
32099impl MessageData for VIDEO_STREAM_STATUS_DATA {
32100 type Message = MavMessage;
32101 const ID: u32 = 270u32;
32102 const NAME: &'static str = "VIDEO_STREAM_STATUS";
32103 const EXTRA_CRC: u8 = 59u8;
32104 const ENCODED_LEN: usize = 20usize;
32105 fn deser(
32106 _version: MavlinkVersion,
32107 __input: &[u8],
32108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32109 let avail_len = __input.len();
32110 let mut payload_buf = [0; Self::ENCODED_LEN];
32111 let mut buf = if avail_len < Self::ENCODED_LEN {
32112 payload_buf[0..avail_len].copy_from_slice(__input);
32113 Bytes::new(&payload_buf)
32114 } else {
32115 Bytes::new(__input)
32116 };
32117 let mut __struct = Self::default();
32118 __struct.framerate = buf.get_f32_le();
32119 __struct.bitrate = buf.get_u32_le();
32120 let tmp = buf.get_u16_le();
32121 __struct.flags = VideoStreamStatusFlags::from_bits(
32122 tmp & VideoStreamStatusFlags::all().bits(),
32123 )
32124 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32125 flag_type: "VideoStreamStatusFlags",
32126 value: tmp as u32,
32127 })?;
32128 __struct.resolution_h = buf.get_u16_le();
32129 __struct.resolution_v = buf.get_u16_le();
32130 __struct.rotation = buf.get_u16_le();
32131 __struct.hfov = buf.get_u16_le();
32132 __struct.stream_id = buf.get_u8();
32133 __struct.camera_device_id = buf.get_u8();
32134 Ok(__struct)
32135 }
32136 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32137 let mut __tmp = BytesMut::new(bytes);
32138 #[allow(clippy::absurd_extreme_comparisons)]
32139 #[allow(unused_comparisons)]
32140 if __tmp.remaining() < Self::ENCODED_LEN {
32141 panic!(
32142 "buffer is too small (need {} bytes, but got {})",
32143 Self::ENCODED_LEN,
32144 __tmp.remaining(),
32145 )
32146 }
32147 __tmp.put_f32_le(self.framerate);
32148 __tmp.put_u32_le(self.bitrate);
32149 __tmp.put_u16_le(self.flags.bits());
32150 __tmp.put_u16_le(self.resolution_h);
32151 __tmp.put_u16_le(self.resolution_v);
32152 __tmp.put_u16_le(self.rotation);
32153 __tmp.put_u16_le(self.hfov);
32154 __tmp.put_u8(self.stream_id);
32155 if matches!(version, MavlinkVersion::V2) {
32156 __tmp.put_u8(self.camera_device_id);
32157 let len = __tmp.len();
32158 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32159 } else {
32160 __tmp.len()
32161 }
32162 }
32163}
32164#[doc = "Local position/attitude estimate from a vision source."]
32165#[doc = ""]
32166#[doc = "ID: 102"]
32167#[derive(Debug, Clone, PartialEq)]
32168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32170#[cfg_attr(feature = "ts", derive(TS))]
32171#[cfg_attr(feature = "ts", ts(export))]
32172pub struct VISION_POSITION_ESTIMATE_DATA {
32173 #[doc = "Timestamp (UNIX time or time since system boot)"]
32174 pub usec: u64,
32175 #[doc = "Local X position"]
32176 pub x: f32,
32177 #[doc = "Local Y position"]
32178 pub y: f32,
32179 #[doc = "Local Z position"]
32180 pub z: f32,
32181 #[doc = "Roll angle"]
32182 pub roll: f32,
32183 #[doc = "Pitch angle"]
32184 pub pitch: f32,
32185 #[doc = "Yaw angle"]
32186 pub yaw: f32,
32187 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
32188 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32189 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32190 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32191 pub covariance: [f32; 21],
32192 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32193 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32194 pub reset_counter: u8,
32195}
32196impl VISION_POSITION_ESTIMATE_DATA {
32197 pub const ENCODED_LEN: usize = 117usize;
32198 pub const DEFAULT: Self = Self {
32199 usec: 0_u64,
32200 x: 0.0_f32,
32201 y: 0.0_f32,
32202 z: 0.0_f32,
32203 roll: 0.0_f32,
32204 pitch: 0.0_f32,
32205 yaw: 0.0_f32,
32206 covariance: [0.0_f32; 21usize],
32207 reset_counter: 0_u8,
32208 };
32209 #[cfg(feature = "arbitrary")]
32210 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32211 use arbitrary::{Arbitrary, Unstructured};
32212 let mut buf = [0u8; 1024];
32213 rng.fill_bytes(&mut buf);
32214 let mut unstructured = Unstructured::new(&buf);
32215 Self::arbitrary(&mut unstructured).unwrap_or_default()
32216 }
32217}
32218impl Default for VISION_POSITION_ESTIMATE_DATA {
32219 fn default() -> Self {
32220 Self::DEFAULT.clone()
32221 }
32222}
32223impl MessageData for VISION_POSITION_ESTIMATE_DATA {
32224 type Message = MavMessage;
32225 const ID: u32 = 102u32;
32226 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
32227 const EXTRA_CRC: u8 = 158u8;
32228 const ENCODED_LEN: usize = 117usize;
32229 fn deser(
32230 _version: MavlinkVersion,
32231 __input: &[u8],
32232 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32233 let avail_len = __input.len();
32234 let mut payload_buf = [0; Self::ENCODED_LEN];
32235 let mut buf = if avail_len < Self::ENCODED_LEN {
32236 payload_buf[0..avail_len].copy_from_slice(__input);
32237 Bytes::new(&payload_buf)
32238 } else {
32239 Bytes::new(__input)
32240 };
32241 let mut __struct = Self::default();
32242 __struct.usec = buf.get_u64_le();
32243 __struct.x = buf.get_f32_le();
32244 __struct.y = buf.get_f32_le();
32245 __struct.z = buf.get_f32_le();
32246 __struct.roll = buf.get_f32_le();
32247 __struct.pitch = buf.get_f32_le();
32248 __struct.yaw = buf.get_f32_le();
32249 for v in &mut __struct.covariance {
32250 let val = buf.get_f32_le();
32251 *v = val;
32252 }
32253 __struct.reset_counter = buf.get_u8();
32254 Ok(__struct)
32255 }
32256 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32257 let mut __tmp = BytesMut::new(bytes);
32258 #[allow(clippy::absurd_extreme_comparisons)]
32259 #[allow(unused_comparisons)]
32260 if __tmp.remaining() < Self::ENCODED_LEN {
32261 panic!(
32262 "buffer is too small (need {} bytes, but got {})",
32263 Self::ENCODED_LEN,
32264 __tmp.remaining(),
32265 )
32266 }
32267 __tmp.put_u64_le(self.usec);
32268 __tmp.put_f32_le(self.x);
32269 __tmp.put_f32_le(self.y);
32270 __tmp.put_f32_le(self.z);
32271 __tmp.put_f32_le(self.roll);
32272 __tmp.put_f32_le(self.pitch);
32273 __tmp.put_f32_le(self.yaw);
32274 if matches!(version, MavlinkVersion::V2) {
32275 for val in &self.covariance {
32276 __tmp.put_f32_le(*val);
32277 }
32278 __tmp.put_u8(self.reset_counter);
32279 let len = __tmp.len();
32280 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32281 } else {
32282 __tmp.len()
32283 }
32284 }
32285}
32286#[doc = "Speed estimate from a vision source."]
32287#[doc = ""]
32288#[doc = "ID: 103"]
32289#[derive(Debug, Clone, PartialEq)]
32290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32292#[cfg_attr(feature = "ts", derive(TS))]
32293#[cfg_attr(feature = "ts", ts(export))]
32294pub struct VISION_SPEED_ESTIMATE_DATA {
32295 #[doc = "Timestamp (UNIX time or time since system boot)"]
32296 pub usec: u64,
32297 #[doc = "Global X speed"]
32298 pub x: f32,
32299 #[doc = "Global Y speed"]
32300 pub y: f32,
32301 #[doc = "Global Z speed"]
32302 pub z: f32,
32303 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
32304 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32305 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32306 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32307 pub covariance: [f32; 9],
32308 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32309 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32310 pub reset_counter: u8,
32311}
32312impl VISION_SPEED_ESTIMATE_DATA {
32313 pub const ENCODED_LEN: usize = 57usize;
32314 pub const DEFAULT: Self = Self {
32315 usec: 0_u64,
32316 x: 0.0_f32,
32317 y: 0.0_f32,
32318 z: 0.0_f32,
32319 covariance: [0.0_f32; 9usize],
32320 reset_counter: 0_u8,
32321 };
32322 #[cfg(feature = "arbitrary")]
32323 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32324 use arbitrary::{Arbitrary, Unstructured};
32325 let mut buf = [0u8; 1024];
32326 rng.fill_bytes(&mut buf);
32327 let mut unstructured = Unstructured::new(&buf);
32328 Self::arbitrary(&mut unstructured).unwrap_or_default()
32329 }
32330}
32331impl Default for VISION_SPEED_ESTIMATE_DATA {
32332 fn default() -> Self {
32333 Self::DEFAULT.clone()
32334 }
32335}
32336impl MessageData for VISION_SPEED_ESTIMATE_DATA {
32337 type Message = MavMessage;
32338 const ID: u32 = 103u32;
32339 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
32340 const EXTRA_CRC: u8 = 208u8;
32341 const ENCODED_LEN: usize = 57usize;
32342 fn deser(
32343 _version: MavlinkVersion,
32344 __input: &[u8],
32345 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32346 let avail_len = __input.len();
32347 let mut payload_buf = [0; Self::ENCODED_LEN];
32348 let mut buf = if avail_len < Self::ENCODED_LEN {
32349 payload_buf[0..avail_len].copy_from_slice(__input);
32350 Bytes::new(&payload_buf)
32351 } else {
32352 Bytes::new(__input)
32353 };
32354 let mut __struct = Self::default();
32355 __struct.usec = buf.get_u64_le();
32356 __struct.x = buf.get_f32_le();
32357 __struct.y = buf.get_f32_le();
32358 __struct.z = buf.get_f32_le();
32359 for v in &mut __struct.covariance {
32360 let val = buf.get_f32_le();
32361 *v = val;
32362 }
32363 __struct.reset_counter = buf.get_u8();
32364 Ok(__struct)
32365 }
32366 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32367 let mut __tmp = BytesMut::new(bytes);
32368 #[allow(clippy::absurd_extreme_comparisons)]
32369 #[allow(unused_comparisons)]
32370 if __tmp.remaining() < Self::ENCODED_LEN {
32371 panic!(
32372 "buffer is too small (need {} bytes, but got {})",
32373 Self::ENCODED_LEN,
32374 __tmp.remaining(),
32375 )
32376 }
32377 __tmp.put_u64_le(self.usec);
32378 __tmp.put_f32_le(self.x);
32379 __tmp.put_f32_le(self.y);
32380 __tmp.put_f32_le(self.z);
32381 if matches!(version, MavlinkVersion::V2) {
32382 for val in &self.covariance {
32383 __tmp.put_f32_le(*val);
32384 }
32385 __tmp.put_u8(self.reset_counter);
32386 let len = __tmp.len();
32387 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32388 } else {
32389 __tmp.len()
32390 }
32391 }
32392}
32393#[doc = "Cumulative distance traveled for each reported wheel."]
32394#[doc = ""]
32395#[doc = "ID: 9000"]
32396#[derive(Debug, Clone, PartialEq)]
32397#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32398#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32399#[cfg_attr(feature = "ts", derive(TS))]
32400#[cfg_attr(feature = "ts", ts(export))]
32401pub struct WHEEL_DISTANCE_DATA {
32402 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32403 pub time_usec: u64,
32404 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32405 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32406 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32407 pub distance: [f64; 16],
32408 #[doc = "Number of wheels reported."]
32409 pub count: u8,
32410}
32411impl WHEEL_DISTANCE_DATA {
32412 pub const ENCODED_LEN: usize = 137usize;
32413 pub const DEFAULT: Self = Self {
32414 time_usec: 0_u64,
32415 distance: [0.0_f64; 16usize],
32416 count: 0_u8,
32417 };
32418 #[cfg(feature = "arbitrary")]
32419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32420 use arbitrary::{Arbitrary, Unstructured};
32421 let mut buf = [0u8; 1024];
32422 rng.fill_bytes(&mut buf);
32423 let mut unstructured = Unstructured::new(&buf);
32424 Self::arbitrary(&mut unstructured).unwrap_or_default()
32425 }
32426}
32427impl Default for WHEEL_DISTANCE_DATA {
32428 fn default() -> Self {
32429 Self::DEFAULT.clone()
32430 }
32431}
32432impl MessageData for WHEEL_DISTANCE_DATA {
32433 type Message = MavMessage;
32434 const ID: u32 = 9000u32;
32435 const NAME: &'static str = "WHEEL_DISTANCE";
32436 const EXTRA_CRC: u8 = 113u8;
32437 const ENCODED_LEN: usize = 137usize;
32438 fn deser(
32439 _version: MavlinkVersion,
32440 __input: &[u8],
32441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32442 let avail_len = __input.len();
32443 let mut payload_buf = [0; Self::ENCODED_LEN];
32444 let mut buf = if avail_len < Self::ENCODED_LEN {
32445 payload_buf[0..avail_len].copy_from_slice(__input);
32446 Bytes::new(&payload_buf)
32447 } else {
32448 Bytes::new(__input)
32449 };
32450 let mut __struct = Self::default();
32451 __struct.time_usec = buf.get_u64_le();
32452 for v in &mut __struct.distance {
32453 let val = buf.get_f64_le();
32454 *v = val;
32455 }
32456 __struct.count = buf.get_u8();
32457 Ok(__struct)
32458 }
32459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32460 let mut __tmp = BytesMut::new(bytes);
32461 #[allow(clippy::absurd_extreme_comparisons)]
32462 #[allow(unused_comparisons)]
32463 if __tmp.remaining() < Self::ENCODED_LEN {
32464 panic!(
32465 "buffer is too small (need {} bytes, but got {})",
32466 Self::ENCODED_LEN,
32467 __tmp.remaining(),
32468 )
32469 }
32470 __tmp.put_u64_le(self.time_usec);
32471 for val in &self.distance {
32472 __tmp.put_f64_le(*val);
32473 }
32474 __tmp.put_u8(self.count);
32475 if matches!(version, MavlinkVersion::V2) {
32476 let len = __tmp.len();
32477 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32478 } else {
32479 __tmp.len()
32480 }
32481 }
32482}
32483#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32484#[doc = ""]
32485#[doc = "ID: 299"]
32486#[derive(Debug, Clone, PartialEq)]
32487#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32489#[cfg_attr(feature = "ts", derive(TS))]
32490#[cfg_attr(feature = "ts", ts(export))]
32491pub struct WIFI_CONFIG_AP_DATA {
32492 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32493 #[cfg_attr(
32494 feature = "serde",
32495 serde(
32496 serialize_with = "crate::nulstr::serialize::<_, 32>",
32497 deserialize_with = "crate::nulstr::deserialize::<_, 32>"
32498 )
32499 )]
32500 #[cfg_attr(feature = "ts", ts(type = "string"))]
32501 pub ssid: [u8; 32],
32502 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32503 #[cfg_attr(
32504 feature = "serde",
32505 serde(
32506 serialize_with = "crate::nulstr::serialize::<_, 64>",
32507 deserialize_with = "crate::nulstr::deserialize::<_, 64>"
32508 )
32509 )]
32510 #[cfg_attr(feature = "ts", ts(type = "string"))]
32511 pub password: [u8; 64],
32512 #[doc = "WiFi Mode."]
32513 #[cfg_attr(feature = "serde", serde(default))]
32514 pub mode: WifiConfigApMode,
32515 #[doc = "Message acceptance response (sent back to GS)."]
32516 #[cfg_attr(feature = "serde", serde(default))]
32517 pub response: WifiConfigApResponse,
32518}
32519impl WIFI_CONFIG_AP_DATA {
32520 pub const ENCODED_LEN: usize = 98usize;
32521 pub const DEFAULT: Self = Self {
32522 ssid: [0_u8; 32usize],
32523 password: [0_u8; 64usize],
32524 mode: WifiConfigApMode::DEFAULT,
32525 response: WifiConfigApResponse::DEFAULT,
32526 };
32527 #[cfg(feature = "arbitrary")]
32528 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32529 use arbitrary::{Arbitrary, Unstructured};
32530 let mut buf = [0u8; 1024];
32531 rng.fill_bytes(&mut buf);
32532 let mut unstructured = Unstructured::new(&buf);
32533 Self::arbitrary(&mut unstructured).unwrap_or_default()
32534 }
32535}
32536impl Default for WIFI_CONFIG_AP_DATA {
32537 fn default() -> Self {
32538 Self::DEFAULT.clone()
32539 }
32540}
32541impl MessageData for WIFI_CONFIG_AP_DATA {
32542 type Message = MavMessage;
32543 const ID: u32 = 299u32;
32544 const NAME: &'static str = "WIFI_CONFIG_AP";
32545 const EXTRA_CRC: u8 = 19u8;
32546 const ENCODED_LEN: usize = 98usize;
32547 fn deser(
32548 _version: MavlinkVersion,
32549 __input: &[u8],
32550 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32551 let avail_len = __input.len();
32552 let mut payload_buf = [0; Self::ENCODED_LEN];
32553 let mut buf = if avail_len < Self::ENCODED_LEN {
32554 payload_buf[0..avail_len].copy_from_slice(__input);
32555 Bytes::new(&payload_buf)
32556 } else {
32557 Bytes::new(__input)
32558 };
32559 let mut __struct = Self::default();
32560 for v in &mut __struct.ssid {
32561 let val = buf.get_u8();
32562 *v = val;
32563 }
32564 for v in &mut __struct.password {
32565 let val = buf.get_u8();
32566 *v = val;
32567 }
32568 let tmp = buf.get_i8();
32569 __struct.mode =
32570 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32571 enum_type: "WifiConfigApMode",
32572 value: tmp as u32,
32573 })?;
32574 let tmp = buf.get_i8();
32575 __struct.response =
32576 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32577 enum_type: "WifiConfigApResponse",
32578 value: tmp as u32,
32579 })?;
32580 Ok(__struct)
32581 }
32582 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32583 let mut __tmp = BytesMut::new(bytes);
32584 #[allow(clippy::absurd_extreme_comparisons)]
32585 #[allow(unused_comparisons)]
32586 if __tmp.remaining() < Self::ENCODED_LEN {
32587 panic!(
32588 "buffer is too small (need {} bytes, but got {})",
32589 Self::ENCODED_LEN,
32590 __tmp.remaining(),
32591 )
32592 }
32593 for val in &self.ssid {
32594 __tmp.put_u8(*val);
32595 }
32596 for val in &self.password {
32597 __tmp.put_u8(*val);
32598 }
32599 if matches!(version, MavlinkVersion::V2) {
32600 __tmp.put_i8(self.mode as i8);
32601 __tmp.put_i8(self.response as i8);
32602 let len = __tmp.len();
32603 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32604 } else {
32605 __tmp.len()
32606 }
32607 }
32608}
32609#[doc = "Winch status."]
32610#[doc = ""]
32611#[doc = "ID: 9005"]
32612#[derive(Debug, Clone, PartialEq)]
32613#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32614#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32615#[cfg_attr(feature = "ts", derive(TS))]
32616#[cfg_attr(feature = "ts", ts(export))]
32617pub struct WINCH_STATUS_DATA {
32618 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32619 pub time_usec: u64,
32620 #[doc = "Length of line released. NaN if unknown"]
32621 pub line_length: f32,
32622 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32623 pub speed: f32,
32624 #[doc = "Tension on the line. NaN if unknown"]
32625 pub tension: f32,
32626 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32627 pub voltage: f32,
32628 #[doc = "Current draw from the winch. NaN if unknown"]
32629 pub current: f32,
32630 #[doc = "Status flags"]
32631 pub status: MavWinchStatusFlag,
32632 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32633 pub temperature: i16,
32634}
32635impl WINCH_STATUS_DATA {
32636 pub const ENCODED_LEN: usize = 34usize;
32637 pub const DEFAULT: Self = Self {
32638 time_usec: 0_u64,
32639 line_length: 0.0_f32,
32640 speed: 0.0_f32,
32641 tension: 0.0_f32,
32642 voltage: 0.0_f32,
32643 current: 0.0_f32,
32644 status: MavWinchStatusFlag::DEFAULT,
32645 temperature: 0_i16,
32646 };
32647 #[cfg(feature = "arbitrary")]
32648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32649 use arbitrary::{Arbitrary, Unstructured};
32650 let mut buf = [0u8; 1024];
32651 rng.fill_bytes(&mut buf);
32652 let mut unstructured = Unstructured::new(&buf);
32653 Self::arbitrary(&mut unstructured).unwrap_or_default()
32654 }
32655}
32656impl Default for WINCH_STATUS_DATA {
32657 fn default() -> Self {
32658 Self::DEFAULT.clone()
32659 }
32660}
32661impl MessageData for WINCH_STATUS_DATA {
32662 type Message = MavMessage;
32663 const ID: u32 = 9005u32;
32664 const NAME: &'static str = "WINCH_STATUS";
32665 const EXTRA_CRC: u8 = 117u8;
32666 const ENCODED_LEN: usize = 34usize;
32667 fn deser(
32668 _version: MavlinkVersion,
32669 __input: &[u8],
32670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32671 let avail_len = __input.len();
32672 let mut payload_buf = [0; Self::ENCODED_LEN];
32673 let mut buf = if avail_len < Self::ENCODED_LEN {
32674 payload_buf[0..avail_len].copy_from_slice(__input);
32675 Bytes::new(&payload_buf)
32676 } else {
32677 Bytes::new(__input)
32678 };
32679 let mut __struct = Self::default();
32680 __struct.time_usec = buf.get_u64_le();
32681 __struct.line_length = buf.get_f32_le();
32682 __struct.speed = buf.get_f32_le();
32683 __struct.tension = buf.get_f32_le();
32684 __struct.voltage = buf.get_f32_le();
32685 __struct.current = buf.get_f32_le();
32686 let tmp = buf.get_u32_le();
32687 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
32688 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32689 flag_type: "MavWinchStatusFlag",
32690 value: tmp as u32,
32691 })?;
32692 __struct.temperature = buf.get_i16_le();
32693 Ok(__struct)
32694 }
32695 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32696 let mut __tmp = BytesMut::new(bytes);
32697 #[allow(clippy::absurd_extreme_comparisons)]
32698 #[allow(unused_comparisons)]
32699 if __tmp.remaining() < Self::ENCODED_LEN {
32700 panic!(
32701 "buffer is too small (need {} bytes, but got {})",
32702 Self::ENCODED_LEN,
32703 __tmp.remaining(),
32704 )
32705 }
32706 __tmp.put_u64_le(self.time_usec);
32707 __tmp.put_f32_le(self.line_length);
32708 __tmp.put_f32_le(self.speed);
32709 __tmp.put_f32_le(self.tension);
32710 __tmp.put_f32_le(self.voltage);
32711 __tmp.put_f32_le(self.current);
32712 __tmp.put_u32_le(self.status.bits());
32713 __tmp.put_i16_le(self.temperature);
32714 if matches!(version, MavlinkVersion::V2) {
32715 let len = __tmp.len();
32716 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32717 } else {
32718 __tmp.len()
32719 }
32720 }
32721}
32722#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32723#[doc = ""]
32724#[doc = "ID: 231"]
32725#[derive(Debug, Clone, PartialEq)]
32726#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32728#[cfg_attr(feature = "ts", derive(TS))]
32729#[cfg_attr(feature = "ts", ts(export))]
32730pub struct WIND_COV_DATA {
32731 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32732 pub time_usec: u64,
32733 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32734 pub wind_x: f32,
32735 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32736 pub wind_y: f32,
32737 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32738 pub wind_z: f32,
32739 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32740 pub var_horiz: f32,
32741 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32742 pub var_vert: f32,
32743 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32744 pub wind_alt: f32,
32745 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32746 pub horiz_accuracy: f32,
32747 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32748 pub vert_accuracy: f32,
32749}
32750impl WIND_COV_DATA {
32751 pub const ENCODED_LEN: usize = 40usize;
32752 pub const DEFAULT: Self = Self {
32753 time_usec: 0_u64,
32754 wind_x: 0.0_f32,
32755 wind_y: 0.0_f32,
32756 wind_z: 0.0_f32,
32757 var_horiz: 0.0_f32,
32758 var_vert: 0.0_f32,
32759 wind_alt: 0.0_f32,
32760 horiz_accuracy: 0.0_f32,
32761 vert_accuracy: 0.0_f32,
32762 };
32763 #[cfg(feature = "arbitrary")]
32764 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32765 use arbitrary::{Arbitrary, Unstructured};
32766 let mut buf = [0u8; 1024];
32767 rng.fill_bytes(&mut buf);
32768 let mut unstructured = Unstructured::new(&buf);
32769 Self::arbitrary(&mut unstructured).unwrap_or_default()
32770 }
32771}
32772impl Default for WIND_COV_DATA {
32773 fn default() -> Self {
32774 Self::DEFAULT.clone()
32775 }
32776}
32777impl MessageData for WIND_COV_DATA {
32778 type Message = MavMessage;
32779 const ID: u32 = 231u32;
32780 const NAME: &'static str = "WIND_COV";
32781 const EXTRA_CRC: u8 = 105u8;
32782 const ENCODED_LEN: usize = 40usize;
32783 fn deser(
32784 _version: MavlinkVersion,
32785 __input: &[u8],
32786 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32787 let avail_len = __input.len();
32788 let mut payload_buf = [0; Self::ENCODED_LEN];
32789 let mut buf = if avail_len < Self::ENCODED_LEN {
32790 payload_buf[0..avail_len].copy_from_slice(__input);
32791 Bytes::new(&payload_buf)
32792 } else {
32793 Bytes::new(__input)
32794 };
32795 let mut __struct = Self::default();
32796 __struct.time_usec = buf.get_u64_le();
32797 __struct.wind_x = buf.get_f32_le();
32798 __struct.wind_y = buf.get_f32_le();
32799 __struct.wind_z = buf.get_f32_le();
32800 __struct.var_horiz = buf.get_f32_le();
32801 __struct.var_vert = buf.get_f32_le();
32802 __struct.wind_alt = buf.get_f32_le();
32803 __struct.horiz_accuracy = buf.get_f32_le();
32804 __struct.vert_accuracy = buf.get_f32_le();
32805 Ok(__struct)
32806 }
32807 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32808 let mut __tmp = BytesMut::new(bytes);
32809 #[allow(clippy::absurd_extreme_comparisons)]
32810 #[allow(unused_comparisons)]
32811 if __tmp.remaining() < Self::ENCODED_LEN {
32812 panic!(
32813 "buffer is too small (need {} bytes, but got {})",
32814 Self::ENCODED_LEN,
32815 __tmp.remaining(),
32816 )
32817 }
32818 __tmp.put_u64_le(self.time_usec);
32819 __tmp.put_f32_le(self.wind_x);
32820 __tmp.put_f32_le(self.wind_y);
32821 __tmp.put_f32_le(self.wind_z);
32822 __tmp.put_f32_le(self.var_horiz);
32823 __tmp.put_f32_le(self.var_vert);
32824 __tmp.put_f32_le(self.wind_alt);
32825 __tmp.put_f32_le(self.horiz_accuracy);
32826 __tmp.put_f32_le(self.vert_accuracy);
32827 if matches!(version, MavlinkVersion::V2) {
32828 let len = __tmp.len();
32829 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32830 } else {
32831 __tmp.len()
32832 }
32833 }
32834}
32835#[derive(Clone, PartialEq, Debug)]
32836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32837#[cfg_attr(feature = "serde", serde(tag = "type"))]
32838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32839#[cfg_attr(feature = "ts", derive(TS))]
32840#[cfg_attr(feature = "ts", ts(export))]
32841#[repr(u32)]
32842pub enum MavMessage {
32843 #[doc = "Set the vehicle attitude and body angular rates."]
32844 #[doc = ""]
32845 #[doc = "ID: 140"]
32846 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32847 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
32848 #[doc = ""]
32849 #[doc = "ID: 375"]
32850 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32851 #[doc = "The location and information of an ADSB vehicle."]
32852 #[doc = ""]
32853 #[doc = "ID: 246"]
32854 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32855 #[doc = "The location and information of an AIS vessel."]
32856 #[doc = ""]
32857 #[doc = "ID: 301"]
32858 AIS_VESSEL(AIS_VESSEL_DATA),
32859 #[doc = "The current system altitude."]
32860 #[doc = ""]
32861 #[doc = "ID: 141"]
32862 ALTITUDE(ALTITUDE_DATA),
32863 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
32864 #[doc = ""]
32865 #[doc = "ID: 30"]
32866 ATTITUDE(ATTITUDE_DATA),
32867 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32868 #[doc = ""]
32869 #[doc = "ID: 31"]
32870 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32871 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32872 #[doc = ""]
32873 #[doc = "ID: 61"]
32874 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32875 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
32876 #[doc = ""]
32877 #[doc = "ID: 83"]
32878 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32879 #[doc = "Motion capture attitude and position."]
32880 #[doc = ""]
32881 #[doc = "ID: 138"]
32882 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32883 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
32884 #[doc = ""]
32885 #[doc = "ID: 7"]
32886 AUTH_KEY(AUTH_KEY_DATA),
32887 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
32888 #[doc = ""]
32889 #[doc = "ID: 286"]
32890 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32891 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
32892 #[doc = ""]
32893 #[doc = "ID: 148"]
32894 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32895 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
32896 #[doc = ""]
32897 #[doc = "ID: 435"]
32898 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32899 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
32900 #[doc = ""]
32901 #[doc = "ID: 437"]
32902 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32903 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
32904 #[doc = ""]
32905 #[doc = "ID: 372"]
32906 BATTERY_INFO(BATTERY_INFO_DATA),
32907 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
32908 #[doc = ""]
32909 #[doc = "ID: 147"]
32910 BATTERY_STATUS(BATTERY_STATUS_DATA),
32911 #[doc = "Report button state change."]
32912 #[doc = ""]
32913 #[doc = "ID: 257"]
32914 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32915 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32916 #[doc = ""]
32917 #[doc = "ID: 262"]
32918 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32919 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32920 #[doc = ""]
32921 #[doc = "ID: 271"]
32922 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32923 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
32924 #[doc = ""]
32925 #[doc = "ID: 263"]
32926 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32927 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32928 #[doc = ""]
32929 #[doc = "ID: 259"]
32930 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32931 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32932 #[doc = ""]
32933 #[doc = "ID: 260"]
32934 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32935 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
32936 #[doc = ""]
32937 #[doc = "ID: 277"]
32938 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32939 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32940 #[doc = ""]
32941 #[doc = "ID: 276"]
32942 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32943 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32944 #[doc = ""]
32945 #[doc = "ID: 275"]
32946 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32947 #[doc = "Camera-IMU triggering and synchronisation message."]
32948 #[doc = ""]
32949 #[doc = "ID: 112"]
32950 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32951 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
32952 #[doc = ""]
32953 #[doc = "ID: 387"]
32954 CANFD_FRAME(CANFD_FRAME_DATA),
32955 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
32956 #[doc = ""]
32957 #[doc = "ID: 388"]
32958 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32959 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
32960 #[doc = ""]
32961 #[doc = "ID: 386"]
32962 CAN_FRAME(CAN_FRAME_DATA),
32963 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32964 #[doc = ""]
32965 #[doc = "ID: 336"]
32966 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32967 #[doc = "Report current used cellular network status."]
32968 #[doc = ""]
32969 #[doc = "ID: 334"]
32970 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32971 #[doc = "Request to control this MAV."]
32972 #[doc = ""]
32973 #[doc = "ID: 5"]
32974 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32975 #[doc = "Accept / deny control of this MAV."]
32976 #[doc = ""]
32977 #[doc = "ID: 6"]
32978 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32979 #[doc = "Information about a potential collision."]
32980 #[doc = ""]
32981 #[doc = "ID: 247"]
32982 COLLISION(COLLISION_DATA),
32983 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32984 #[doc = ""]
32985 #[doc = "ID: 77"]
32986 COMMAND_ACK(COMMAND_ACK_DATA),
32987 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32988 #[doc = ""]
32989 #[doc = "ID: 80"]
32990 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32991 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32992 #[doc = ""]
32993 #[doc = "ID: 75"]
32994 COMMAND_INT(COMMAND_INT_DATA),
32995 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32996 #[doc = ""]
32997 #[doc = "ID: 76"]
32998 COMMAND_LONG(COMMAND_LONG_DATA),
32999 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
33000 #[doc = ""]
33001 #[doc = "ID: 395"]
33002 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
33003 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
33004 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
33005 #[doc = ""]
33006 #[doc = "ID: 396"]
33007 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
33008 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
33009 #[doc = ""]
33010 #[doc = "ID: 397"]
33011 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
33012 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
33013 #[doc = ""]
33014 #[doc = "ID: 146"]
33015 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
33016 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
33017 #[doc = ""]
33018 #[doc = "ID: 411"]
33019 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
33020 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
33021 #[doc = ""]
33022 #[doc = "ID: 436"]
33023 CURRENT_MODE(CURRENT_MODE_DATA),
33024 #[doc = "Data stream status information."]
33025 #[doc = ""]
33026 #[doc = "ID: 67"]
33027 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
33028 DATA_STREAM(DATA_STREAM_DATA),
33029 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33030 #[doc = ""]
33031 #[doc = "ID: 130"]
33032 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
33033 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
33034 #[doc = ""]
33035 #[doc = "ID: 254"]
33036 DEBUG(DEBUG_DATA),
33037 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
33038 #[doc = ""]
33039 #[doc = "ID: 350"]
33040 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
33041 #[doc = "To debug something using a named 3D vector."]
33042 #[doc = ""]
33043 #[doc = "ID: 250"]
33044 DEBUG_VECT(DEBUG_VECT_DATA),
33045 #[doc = "Distance sensor information for an onboard rangefinder."]
33046 #[doc = ""]
33047 #[doc = "ID: 132"]
33048 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
33049 #[doc = "EFI status output."]
33050 #[doc = ""]
33051 #[doc = "ID: 225"]
33052 EFI_STATUS(EFI_STATUS_DATA),
33053 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33054 #[doc = ""]
33055 #[doc = "ID: 131"]
33056 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
33057 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
33058 #[doc = ""]
33059 #[doc = "ID: 290"]
33060 ESC_INFO(ESC_INFO_DATA),
33061 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
33062 #[doc = ""]
33063 #[doc = "ID: 291"]
33064 ESC_STATUS(ESC_STATUS_DATA),
33065 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
33066 #[doc = ""]
33067 #[doc = "ID: 230"]
33068 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
33069 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
33070 #[doc = ""]
33071 #[doc = "ID: 410"]
33072 EVENT(EVENT_DATA),
33073 #[doc = "Provides state for additional features."]
33074 #[doc = ""]
33075 #[doc = "ID: 245"]
33076 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
33077 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
33078 #[doc = ""]
33079 #[doc = "ID: 162"]
33080 FENCE_STATUS(FENCE_STATUS_DATA),
33081 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
33082 #[doc = ""]
33083 #[doc = "ID: 110"]
33084 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
33085 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
33086 #[doc = ""]
33087 #[doc = "ID: 264"]
33088 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
33089 #[doc = "Current motion information from a designated system."]
33090 #[doc = ""]
33091 #[doc = "ID: 144"]
33092 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
33093 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
33094 #[doc = ""]
33095 #[doc = "ID: 371"]
33096 FUEL_STATUS(FUEL_STATUS_DATA),
33097 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
33098 #[doc = ""]
33099 #[doc = "ID: 373"]
33100 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
33101 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
33102 #[doc = ""]
33103 #[doc = "ID: 285"]
33104 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
33105 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
33106 #[doc = ""]
33107 #[doc = "ID: 283"]
33108 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
33109 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
33110 #[doc = ""]
33111 #[doc = "ID: 284"]
33112 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
33113 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
33114 #[doc = ""]
33115 #[doc = "ID: 280"]
33116 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
33117 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33118 #[doc = ""]
33119 #[doc = "ID: 282"]
33120 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
33121 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33122 #[doc = ""]
33123 #[doc = "ID: 288"]
33124 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
33125 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
33126 #[doc = ""]
33127 #[doc = "ID: 287"]
33128 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
33129 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
33130 #[doc = ""]
33131 #[doc = "ID: 281"]
33132 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
33133 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
33134 #[doc = ""]
33135 #[doc = "ID: 33"]
33136 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
33137 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
33138 #[doc = ""]
33139 #[doc = "ID: 63"]
33140 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
33141 #[doc = "Global position/attitude estimate from a vision source."]
33142 #[doc = ""]
33143 #[doc = "ID: 101"]
33144 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
33145 #[doc = "Second GPS data."]
33146 #[doc = ""]
33147 #[doc = "ID: 124"]
33148 GPS2_RAW(GPS2_RAW_DATA),
33149 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33150 #[doc = ""]
33151 #[doc = "ID: 128"]
33152 GPS2_RTK(GPS2_RTK_DATA),
33153 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
33154 #[doc = ""]
33155 #[doc = "ID: 49"]
33156 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
33157 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
33158 #[doc = ""]
33159 #[doc = "ID: 123"]
33160 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
33161 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
33162 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
33163 #[doc = ""]
33164 #[doc = "ID: 232"]
33165 GPS_INPUT(GPS_INPUT_DATA),
33166 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33167 #[doc = ""]
33168 #[doc = "ID: 24"]
33169 GPS_RAW_INT(GPS_RAW_INT_DATA),
33170 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
33171 #[doc = ""]
33172 #[doc = "ID: 233"]
33173 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
33174 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33175 #[doc = ""]
33176 #[doc = "ID: 127"]
33177 GPS_RTK(GPS_RTK_DATA),
33178 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
33179 #[doc = ""]
33180 #[doc = "ID: 25"]
33181 GPS_STATUS(GPS_STATUS_DATA),
33182 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
33183 #[doc = ""]
33184 #[doc = "ID: 0"]
33185 HEARTBEAT(HEARTBEAT_DATA),
33186 #[doc = "The IMU readings in SI units in NED body frame."]
33187 #[doc = ""]
33188 #[doc = "ID: 105"]
33189 HIGHRES_IMU(HIGHRES_IMU_DATA),
33190 #[doc = "Message appropriate for high latency connections like Iridium."]
33191 #[doc = ""]
33192 #[doc = "ID: 234"]
33193 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
33194 HIGH_LATENCY(HIGH_LATENCY_DATA),
33195 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
33196 #[doc = ""]
33197 #[doc = "ID: 235"]
33198 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
33199 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
33200 #[doc = ""]
33201 #[doc = "ID: 93"]
33202 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
33203 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
33204 #[doc = ""]
33205 #[doc = "ID: 91"]
33206 HIL_CONTROLS(HIL_CONTROLS_DATA),
33207 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33208 #[doc = ""]
33209 #[doc = "ID: 113"]
33210 HIL_GPS(HIL_GPS_DATA),
33211 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
33212 #[doc = ""]
33213 #[doc = "ID: 114"]
33214 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
33215 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
33216 #[doc = ""]
33217 #[doc = "ID: 92"]
33218 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
33219 #[doc = "The IMU readings in SI units in NED body frame."]
33220 #[doc = ""]
33221 #[doc = "ID: 107"]
33222 HIL_SENSOR(HIL_SENSOR_DATA),
33223 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
33224 #[doc = ""]
33225 #[doc = "ID: 90"]
33226 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
33227 HIL_STATE(HIL_STATE_DATA),
33228 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
33229 #[doc = ""]
33230 #[doc = "ID: 115"]
33231 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
33232 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
33233 #[doc = ""]
33234 #[doc = "ID: 242"]
33235 HOME_POSITION(HOME_POSITION_DATA),
33236 #[doc = "Temperature and humidity from hygrometer."]
33237 #[doc = ""]
33238 #[doc = "ID: 12920"]
33239 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
33240 #[doc = "Illuminator status."]
33241 #[doc = ""]
33242 #[doc = "ID: 440"]
33243 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
33244 #[doc = "Status of the Iridium SBD link."]
33245 #[doc = ""]
33246 #[doc = "ID: 335"]
33247 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
33248 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
33249 #[doc = ""]
33250 #[doc = "ID: 149"]
33251 LANDING_TARGET(LANDING_TARGET_DATA),
33252 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
33253 #[doc = ""]
33254 #[doc = "ID: 8"]
33255 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
33256 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33257 #[doc = ""]
33258 #[doc = "ID: 32"]
33259 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
33260 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33261 #[doc = ""]
33262 #[doc = "ID: 64"]
33263 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
33264 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33265 #[doc = ""]
33266 #[doc = "ID: 89"]
33267 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
33268 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
33269 #[doc = ""]
33270 #[doc = "ID: 268"]
33271 LOGGING_ACK(LOGGING_ACK_DATA),
33272 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
33273 #[doc = ""]
33274 #[doc = "ID: 266"]
33275 LOGGING_DATA(LOGGING_DATA_DATA),
33276 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
33277 #[doc = ""]
33278 #[doc = "ID: 267"]
33279 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
33280 #[doc = "Reply to LOG_REQUEST_DATA."]
33281 #[doc = ""]
33282 #[doc = "ID: 120"]
33283 LOG_DATA(LOG_DATA_DATA),
33284 #[doc = "Reply to LOG_REQUEST_LIST."]
33285 #[doc = ""]
33286 #[doc = "ID: 118"]
33287 LOG_ENTRY(LOG_ENTRY_DATA),
33288 #[doc = "Erase all logs."]
33289 #[doc = ""]
33290 #[doc = "ID: 121"]
33291 LOG_ERASE(LOG_ERASE_DATA),
33292 #[doc = "Request a chunk of a log."]
33293 #[doc = ""]
33294 #[doc = "ID: 119"]
33295 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
33296 #[doc = "Stop log transfer and resume normal logging."]
33297 #[doc = ""]
33298 #[doc = "ID: 122"]
33299 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
33300 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
33301 #[doc = ""]
33302 #[doc = "ID: 117"]
33303 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
33304 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
33305 #[doc = ""]
33306 #[doc = "ID: 192"]
33307 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
33308 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
33309 #[doc = ""]
33310 #[doc = "ID: 69"]
33311 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
33312 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
33313 #[doc = ""]
33314 #[doc = "ID: 81"]
33315 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
33316 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33317 #[doc = ""]
33318 #[doc = "ID: 249"]
33319 MEMORY_VECT(MEMORY_VECT_DATA),
33320 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
33321 #[doc = ""]
33322 #[doc = "ID: 244"]
33323 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
33324 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
33325 #[doc = ""]
33326 #[doc = "ID: 47"]
33327 MISSION_ACK(MISSION_ACK_DATA),
33328 #[doc = "Delete all mission items at once."]
33329 #[doc = ""]
33330 #[doc = "ID: 45"]
33331 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
33332 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
33333 #[doc = ""]
33334 #[doc = "ID: 44"]
33335 MISSION_COUNT(MISSION_COUNT_DATA),
33336 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
33337 #[doc = ""]
33338 #[doc = "ID: 42"]
33339 MISSION_CURRENT(MISSION_CURRENT_DATA),
33340 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33341 #[doc = ""]
33342 #[doc = "ID: 39"]
33343 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
33344 MISSION_ITEM(MISSION_ITEM_DATA),
33345 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33346 #[doc = ""]
33347 #[doc = "ID: 73"]
33348 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
33349 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
33350 #[doc = ""]
33351 #[doc = "ID: 46"]
33352 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
33353 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
33354 #[doc = ""]
33355 #[doc = "ID: 40"]
33356 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
33357 MISSION_REQUEST(MISSION_REQUEST_DATA),
33358 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
33359 #[doc = ""]
33360 #[doc = "ID: 51"]
33361 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33362 #[doc = "Request the overall list of mission items from the system/component."]
33363 #[doc = ""]
33364 #[doc = "ID: 43"]
33365 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33366 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
33367 #[doc = ""]
33368 #[doc = "ID: 37"]
33369 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33370 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
33371 #[doc = ""]
33372 #[doc = "ID: 41"]
33373 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33374 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33375 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
33376 #[doc = ""]
33377 #[doc = "ID: 38"]
33378 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33379 #[doc = "Orientation of a mount."]
33380 #[doc = ""]
33381 #[doc = "ID: 265"]
33382 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33383 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33384 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33385 #[doc = ""]
33386 #[doc = "ID: 251"]
33387 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33388 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33389 #[doc = ""]
33390 #[doc = "ID: 252"]
33391 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33392 #[doc = "The state of the navigation and position controller."]
33393 #[doc = ""]
33394 #[doc = "ID: 62"]
33395 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33396 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
33397 #[doc = ""]
33398 #[doc = "ID: 330"]
33399 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33400 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
33401 #[doc = ""]
33402 #[doc = "ID: 331"]
33403 ODOMETRY(ODOMETRY_DATA),
33404 #[doc = "Hardware status sent by an onboard computer."]
33405 #[doc = ""]
33406 #[doc = "ID: 390"]
33407 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33408 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
33409 #[doc = ""]
33410 #[doc = "ID: 12918"]
33411 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33412 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
33413 #[doc = ""]
33414 #[doc = "ID: 12902"]
33415 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33416 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
33417 #[doc = ""]
33418 #[doc = "ID: 12900"]
33419 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33420 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
33421 #[doc = ""]
33422 #[doc = "ID: 12901"]
33423 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33424 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
33425 #[doc = ""]
33426 #[doc = "ID: 12915"]
33427 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33428 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
33429 #[doc = ""]
33430 #[doc = "ID: 12905"]
33431 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33432 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
33433 #[doc = ""]
33434 #[doc = "ID: 12903"]
33435 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33436 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
33437 #[doc = ""]
33438 #[doc = "ID: 12904"]
33439 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33440 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
33441 #[doc = ""]
33442 #[doc = "ID: 12919"]
33443 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33444 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
33445 #[doc = ""]
33446 #[doc = "ID: 100"]
33447 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33448 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
33449 #[doc = ""]
33450 #[doc = "ID: 106"]
33451 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33452 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
33453 #[doc = ""]
33454 #[doc = "ID: 360"]
33455 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33456 #[doc = "Response from a PARAM_EXT_SET message."]
33457 #[doc = ""]
33458 #[doc = "ID: 324"]
33459 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33460 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
33461 #[doc = ""]
33462 #[doc = "ID: 321"]
33463 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33464 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
33465 #[doc = ""]
33466 #[doc = "ID: 320"]
33467 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33468 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
33469 #[doc = ""]
33470 #[doc = "ID: 323"]
33471 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33472 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
33473 #[doc = ""]
33474 #[doc = "ID: 322"]
33475 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33476 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
33477 #[doc = ""]
33478 #[doc = "ID: 50"]
33479 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33480 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33481 #[doc = ""]
33482 #[doc = "ID: 21"]
33483 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33484 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
33485 #[doc = ""]
33486 #[doc = "ID: 20"]
33487 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33488 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33489 #[doc = ""]
33490 #[doc = "ID: 23"]
33491 PARAM_SET(PARAM_SET_DATA),
33492 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33493 #[doc = ""]
33494 #[doc = "ID: 22"]
33495 PARAM_VALUE(PARAM_VALUE_DATA),
33496 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
33497 #[doc = ""]
33498 #[doc = "ID: 4"]
33499 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33500 PING(PING_DATA),
33501 #[doc = "Control vehicle tone generation (buzzer)."]
33502 #[doc = ""]
33503 #[doc = "ID: 258"]
33504 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33505 PLAY_TUNE(PLAY_TUNE_DATA),
33506 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
33507 #[doc = ""]
33508 #[doc = "ID: 400"]
33509 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33510 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
33511 #[doc = ""]
33512 #[doc = "ID: 87"]
33513 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33514 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
33515 #[doc = ""]
33516 #[doc = "ID: 85"]
33517 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33518 #[doc = "Power supply status."]
33519 #[doc = ""]
33520 #[doc = "ID: 125"]
33521 POWER_STATUS(POWER_STATUS_DATA),
33522 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
33523 #[doc = ""]
33524 #[doc = "ID: 300"]
33525 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33526 #[doc = "Status generated by radio and injected into MAVLink stream."]
33527 #[doc = ""]
33528 #[doc = "ID: 109"]
33529 RADIO_STATUS(RADIO_STATUS_DATA),
33530 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33531 #[doc = ""]
33532 #[doc = "ID: 27"]
33533 RAW_IMU(RAW_IMU_DATA),
33534 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33535 #[doc = ""]
33536 #[doc = "ID: 28"]
33537 RAW_PRESSURE(RAW_PRESSURE_DATA),
33538 #[doc = "RPM sensor data message."]
33539 #[doc = ""]
33540 #[doc = "ID: 339"]
33541 RAW_RPM(RAW_RPM_DATA),
33542 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33543 #[doc = ""]
33544 #[doc = "ID: 65"]
33545 RC_CHANNELS(RC_CHANNELS_DATA),
33546 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33547 #[doc = ""]
33548 #[doc = "ID: 70"]
33549 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33550 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33551 #[doc = ""]
33552 #[doc = "ID: 35"]
33553 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33554 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33555 #[doc = ""]
33556 #[doc = "ID: 34"]
33557 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33558 #[doc = "Request a data stream."]
33559 #[doc = ""]
33560 #[doc = "ID: 66"]
33561 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33562 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33563 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
33564 #[doc = ""]
33565 #[doc = "ID: 412"]
33566 REQUEST_EVENT(REQUEST_EVENT_DATA),
33567 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
33568 #[doc = ""]
33569 #[doc = "ID: 142"]
33570 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33571 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
33572 #[doc = ""]
33573 #[doc = "ID: 413"]
33574 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33575 #[doc = "Read out the safety zone the MAV currently assumes."]
33576 #[doc = ""]
33577 #[doc = "ID: 55"]
33578 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33579 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
33580 #[doc = ""]
33581 #[doc = "ID: 54"]
33582 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33583 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
33584 #[doc = ""]
33585 #[doc = "ID: 26"]
33586 SCALED_IMU(SCALED_IMU_DATA),
33587 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
33588 #[doc = ""]
33589 #[doc = "ID: 116"]
33590 SCALED_IMU2(SCALED_IMU2_DATA),
33591 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
33592 #[doc = ""]
33593 #[doc = "ID: 129"]
33594 SCALED_IMU3(SCALED_IMU3_DATA),
33595 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
33596 #[doc = ""]
33597 #[doc = "ID: 29"]
33598 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33599 #[doc = "Barometer readings for 2nd barometer."]
33600 #[doc = ""]
33601 #[doc = "ID: 137"]
33602 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33603 #[doc = "Barometer readings for 3rd barometer."]
33604 #[doc = ""]
33605 #[doc = "ID: 143"]
33606 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33607 #[doc = "This message is emitted as response to SCRIPT_REQUEST_LIST by the MAV to get the number of mission scripts."]
33608 #[doc = ""]
33609 #[doc = "ID: 183"]
33610 SCRIPT_COUNT(SCRIPT_COUNT_DATA),
33611 #[doc = "This message informs about the currently active SCRIPT."]
33612 #[doc = ""]
33613 #[doc = "ID: 184"]
33614 SCRIPT_CURRENT(SCRIPT_CURRENT_DATA),
33615 #[doc = "Message encoding a mission script item. This message is emitted upon a request for the next script item."]
33616 #[doc = ""]
33617 #[doc = "ID: 180"]
33618 SCRIPT_ITEM(SCRIPT_ITEM_DATA),
33619 #[doc = "Request script item with the sequence number seq. The response of the system to this message should be a SCRIPT_ITEM message."]
33620 #[doc = ""]
33621 #[doc = "ID: 181"]
33622 SCRIPT_REQUEST(SCRIPT_REQUEST_DATA),
33623 #[doc = "Request the overall list of mission items from the system/component."]
33624 #[doc = ""]
33625 #[doc = "ID: 182"]
33626 SCRIPT_REQUEST_LIST(SCRIPT_REQUEST_LIST_DATA),
33627 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
33628 #[doc = ""]
33629 #[doc = "ID: 126"]
33630 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33631 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
33632 #[doc = ""]
33633 #[doc = "ID: 36"]
33634 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33635 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
33636 #[doc = ""]
33637 #[doc = "ID: 256"]
33638 SETUP_SIGNING(SETUP_SIGNING_DATA),
33639 #[doc = "Set the vehicle attitude and body angular rates."]
33640 #[doc = ""]
33641 #[doc = "ID: 139"]
33642 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33643 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
33644 #[doc = ""]
33645 #[doc = "ID: 82"]
33646 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33647 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
33648 #[doc = ""]
33649 #[doc = "ID: 48"]
33650 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33651 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33652 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
33653 #[doc = ""]
33654 #[doc = "ID: 243"]
33655 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33656 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33657 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
33658 #[doc = ""]
33659 #[doc = "ID: 11"]
33660 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33661 SET_MODE(SET_MODE_DATA),
33662 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
33663 #[doc = ""]
33664 #[doc = "ID: 86"]
33665 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33666 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
33667 #[doc = ""]
33668 #[doc = "ID: 84"]
33669 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33670 #[doc = "Status of simulation environment, if used."]
33671 #[doc = ""]
33672 #[doc = "ID: 108"]
33673 SIM_STATE(SIM_STATE_DATA),
33674 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
33675 #[doc = ""]
33676 #[doc = "ID: 370"]
33677 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33678 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33679 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
33680 #[doc = ""]
33681 #[doc = "ID: 253"]
33682 STATUSTEXT(STATUSTEXT_DATA),
33683 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
33684 #[doc = ""]
33685 #[doc = "ID: 261"]
33686 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33687 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
33688 #[doc = ""]
33689 #[doc = "ID: 401"]
33690 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33691 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
33692 #[doc = ""]
33693 #[doc = "ID: 2"]
33694 SYSTEM_TIME(SYSTEM_TIME_DATA),
33695 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
33696 #[doc = ""]
33697 #[doc = "ID: 1"]
33698 SYS_STATUS(SYS_STATUS_DATA),
33699 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
33700 #[doc = ""]
33701 #[doc = "ID: 135"]
33702 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33703 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33704 #[doc = ""]
33705 #[doc = "ID: 134"]
33706 TERRAIN_DATA(TERRAIN_DATA_DATA),
33707 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33708 #[doc = ""]
33709 #[doc = "ID: 136"]
33710 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33711 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33712 #[doc = ""]
33713 #[doc = "ID: 133"]
33714 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33715 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
33716 #[doc = ""]
33717 #[doc = "ID: 111"]
33718 TIMESYNC(TIMESYNC_DATA),
33719 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
33720 #[doc = ""]
33721 #[doc = "ID: 380"]
33722 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33723 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
33724 #[doc = ""]
33725 #[doc = "ID: 333"]
33726 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33727 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
33728 #[doc = ""]
33729 #[doc = "ID: 332"]
33730 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33731 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33732 #[doc = ""]
33733 #[doc = "ID: 385"]
33734 TUNNEL(TUNNEL_DATA),
33735 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33736 #[doc = ""]
33737 #[doc = "ID: 311"]
33738 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33739 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33740 #[doc = ""]
33741 #[doc = "ID: 310"]
33742 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33743 #[doc = "The global position resulting from GPS and sensor fusion."]
33744 #[doc = ""]
33745 #[doc = "ID: 340"]
33746 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33747 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33748 #[doc = ""]
33749 #[doc = "ID: 248"]
33750 V2_EXTENSION(V2_EXTENSION_DATA),
33751 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33752 #[doc = ""]
33753 #[doc = "ID: 74"]
33754 VFR_HUD(VFR_HUD_DATA),
33755 #[doc = "Vibration levels and accelerometer clipping."]
33756 #[doc = ""]
33757 #[doc = "ID: 241"]
33758 VIBRATION(VIBRATION_DATA),
33759 #[doc = "Global position estimate from a Vicon motion system source."]
33760 #[doc = ""]
33761 #[doc = "ID: 104"]
33762 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33763 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33764 #[doc = ""]
33765 #[doc = "ID: 269"]
33766 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33767 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33768 #[doc = ""]
33769 #[doc = "ID: 270"]
33770 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33771 #[doc = "Local position/attitude estimate from a vision source."]
33772 #[doc = ""]
33773 #[doc = "ID: 102"]
33774 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33775 #[doc = "Speed estimate from a vision source."]
33776 #[doc = ""]
33777 #[doc = "ID: 103"]
33778 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33779 #[doc = "Cumulative distance traveled for each reported wheel."]
33780 #[doc = ""]
33781 #[doc = "ID: 9000"]
33782 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33783 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33784 #[doc = ""]
33785 #[doc = "ID: 299"]
33786 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33787 #[doc = "Winch status."]
33788 #[doc = ""]
33789 #[doc = "ID: 9005"]
33790 WINCH_STATUS(WINCH_STATUS_DATA),
33791 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33792 #[doc = ""]
33793 #[doc = "ID: 231"]
33794 WIND_COV(WIND_COV_DATA),
33795}
33796impl MavMessage {
33797 pub const fn all_ids() -> &'static [u32] {
33798 &[
33799 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33800 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33801 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33802 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33803 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33804 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33805 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33806 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33807 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33808 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33809 148u32, 149u32, 162u32, 180u32, 181u32, 182u32, 183u32, 184u32, 192u32, 225u32, 230u32,
33810 231u32, 232u32, 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32,
33811 247u32, 248u32, 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32,
33812 259u32, 260u32, 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32,
33813 270u32, 271u32, 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32,
33814 286u32, 287u32, 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32,
33815 321u32, 322u32, 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32,
33816 339u32, 340u32, 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32,
33817 386u32, 387u32, 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32,
33818 412u32, 413u32, 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 12900u32, 12901u32,
33819 12902u32, 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
33820 ]
33821 }
33822}
33823impl Message for MavMessage {
33824 fn parse(
33825 version: MavlinkVersion,
33826 id: u32,
33827 payload: &[u8],
33828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33829 match id {
33830 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33831 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33832 .map(Self::ACTUATOR_CONTROL_TARGET)
33833 }
33834 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33835 .map(Self::ACTUATOR_OUTPUT_STATUS),
33836 ADSB_VEHICLE_DATA::ID => {
33837 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33838 }
33839 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33840 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33841 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33842 ATTITUDE_QUATERNION_DATA::ID => {
33843 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33844 }
33845 ATTITUDE_QUATERNION_COV_DATA::ID => {
33846 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33847 .map(Self::ATTITUDE_QUATERNION_COV)
33848 }
33849 ATTITUDE_TARGET_DATA::ID => {
33850 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33851 }
33852 ATT_POS_MOCAP_DATA::ID => {
33853 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33854 }
33855 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33856 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33857 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33858 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33859 }
33860 AUTOPILOT_VERSION_DATA::ID => {
33861 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33862 }
33863 AVAILABLE_MODES_DATA::ID => {
33864 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33865 }
33866 AVAILABLE_MODES_MONITOR_DATA::ID => {
33867 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33868 .map(Self::AVAILABLE_MODES_MONITOR)
33869 }
33870 BATTERY_INFO_DATA::ID => {
33871 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33872 }
33873 BATTERY_STATUS_DATA::ID => {
33874 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33875 }
33876 BUTTON_CHANGE_DATA::ID => {
33877 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33878 }
33879 CAMERA_CAPTURE_STATUS_DATA::ID => {
33880 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33881 }
33882 CAMERA_FOV_STATUS_DATA::ID => {
33883 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33884 }
33885 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33886 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33887 }
33888 CAMERA_INFORMATION_DATA::ID => {
33889 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33890 }
33891 CAMERA_SETTINGS_DATA::ID => {
33892 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33893 }
33894 CAMERA_THERMAL_RANGE_DATA::ID => {
33895 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33896 }
33897 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33898 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33899 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33900 }
33901 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33902 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33903 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33904 }
33905 CAMERA_TRIGGER_DATA::ID => {
33906 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33907 }
33908 CANFD_FRAME_DATA::ID => {
33909 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33910 }
33911 CAN_FILTER_MODIFY_DATA::ID => {
33912 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33913 }
33914 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33915 CELLULAR_CONFIG_DATA::ID => {
33916 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33917 }
33918 CELLULAR_STATUS_DATA::ID => {
33919 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33920 }
33921 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33922 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33923 .map(Self::CHANGE_OPERATOR_CONTROL)
33924 }
33925 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33926 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33927 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33928 }
33929 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33930 COMMAND_ACK_DATA::ID => {
33931 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33932 }
33933 COMMAND_CANCEL_DATA::ID => {
33934 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33935 }
33936 COMMAND_INT_DATA::ID => {
33937 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33938 }
33939 COMMAND_LONG_DATA::ID => {
33940 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33941 }
33942 COMPONENT_INFORMATION_DATA::ID => {
33943 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33944 }
33945 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33946 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33947 .map(Self::COMPONENT_INFORMATION_BASIC)
33948 }
33949 COMPONENT_METADATA_DATA::ID => {
33950 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33951 }
33952 CONTROL_SYSTEM_STATE_DATA::ID => {
33953 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33954 }
33955 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33956 .map(Self::CURRENT_EVENT_SEQUENCE),
33957 CURRENT_MODE_DATA::ID => {
33958 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33959 }
33960 DATA_STREAM_DATA::ID => {
33961 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33962 }
33963 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33964 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33965 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33966 }
33967 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33968 DEBUG_FLOAT_ARRAY_DATA::ID => {
33969 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33970 }
33971 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33972 DISTANCE_SENSOR_DATA::ID => {
33973 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33974 }
33975 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33976 ENCAPSULATED_DATA_DATA::ID => {
33977 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33978 }
33979 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33980 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33981 ESTIMATOR_STATUS_DATA::ID => {
33982 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33983 }
33984 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33985 EXTENDED_SYS_STATE_DATA::ID => {
33986 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33987 }
33988 FENCE_STATUS_DATA::ID => {
33989 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33990 }
33991 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33992 .map(Self::FILE_TRANSFER_PROTOCOL),
33993 FLIGHT_INFORMATION_DATA::ID => {
33994 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33995 }
33996 FOLLOW_TARGET_DATA::ID => {
33997 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33998 }
33999 FUEL_STATUS_DATA::ID => {
34000 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
34001 }
34002 GENERATOR_STATUS_DATA::ID => {
34003 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
34004 }
34005 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
34006 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
34007 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
34008 }
34009 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
34010 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
34011 .map(Self::GIMBAL_DEVICE_INFORMATION)
34012 }
34013 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
34014 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
34015 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
34016 }
34017 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
34018 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
34019 .map(Self::GIMBAL_MANAGER_INFORMATION)
34020 }
34021 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
34022 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
34023 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
34024 }
34025 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34026 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
34027 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
34028 }
34029 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
34030 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
34031 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
34032 }
34033 GIMBAL_MANAGER_STATUS_DATA::ID => {
34034 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
34035 }
34036 GLOBAL_POSITION_INT_DATA::ID => {
34037 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
34038 }
34039 GLOBAL_POSITION_INT_COV_DATA::ID => {
34040 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
34041 .map(Self::GLOBAL_POSITION_INT_COV)
34042 }
34043 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34044 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34045 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
34046 }
34047 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
34048 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
34049 GPS_GLOBAL_ORIGIN_DATA::ID => {
34050 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
34051 }
34052 GPS_INJECT_DATA_DATA::ID => {
34053 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
34054 }
34055 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
34056 GPS_RAW_INT_DATA::ID => {
34057 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
34058 }
34059 GPS_RTCM_DATA_DATA::ID => {
34060 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
34061 }
34062 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
34063 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
34064 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
34065 HIGHRES_IMU_DATA::ID => {
34066 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
34067 }
34068 HIGH_LATENCY_DATA::ID => {
34069 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
34070 }
34071 HIGH_LATENCY2_DATA::ID => {
34072 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
34073 }
34074 HIL_ACTUATOR_CONTROLS_DATA::ID => {
34075 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
34076 }
34077 HIL_CONTROLS_DATA::ID => {
34078 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
34079 }
34080 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
34081 HIL_OPTICAL_FLOW_DATA::ID => {
34082 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
34083 }
34084 HIL_RC_INPUTS_RAW_DATA::ID => {
34085 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
34086 }
34087 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
34088 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
34089 HIL_STATE_QUATERNION_DATA::ID => {
34090 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
34091 }
34092 HOME_POSITION_DATA::ID => {
34093 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
34094 }
34095 HYGROMETER_SENSOR_DATA::ID => {
34096 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
34097 }
34098 ILLUMINATOR_STATUS_DATA::ID => {
34099 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
34100 }
34101 ISBD_LINK_STATUS_DATA::ID => {
34102 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
34103 }
34104 LANDING_TARGET_DATA::ID => {
34105 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
34106 }
34107 LINK_NODE_STATUS_DATA::ID => {
34108 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
34109 }
34110 LOCAL_POSITION_NED_DATA::ID => {
34111 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
34112 }
34113 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
34114 .map(Self::LOCAL_POSITION_NED_COV),
34115 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34116 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
34117 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
34118 }
34119 LOGGING_ACK_DATA::ID => {
34120 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
34121 }
34122 LOGGING_DATA_DATA::ID => {
34123 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
34124 }
34125 LOGGING_DATA_ACKED_DATA::ID => {
34126 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
34127 }
34128 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
34129 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
34130 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
34131 LOG_REQUEST_DATA_DATA::ID => {
34132 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
34133 }
34134 LOG_REQUEST_END_DATA::ID => {
34135 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
34136 }
34137 LOG_REQUEST_LIST_DATA::ID => {
34138 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
34139 }
34140 MAG_CAL_REPORT_DATA::ID => {
34141 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
34142 }
34143 MANUAL_CONTROL_DATA::ID => {
34144 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
34145 }
34146 MANUAL_SETPOINT_DATA::ID => {
34147 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
34148 }
34149 MEMORY_VECT_DATA::ID => {
34150 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
34151 }
34152 MESSAGE_INTERVAL_DATA::ID => {
34153 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
34154 }
34155 MISSION_ACK_DATA::ID => {
34156 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
34157 }
34158 MISSION_CLEAR_ALL_DATA::ID => {
34159 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
34160 }
34161 MISSION_COUNT_DATA::ID => {
34162 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
34163 }
34164 MISSION_CURRENT_DATA::ID => {
34165 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
34166 }
34167 MISSION_ITEM_DATA::ID => {
34168 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
34169 }
34170 MISSION_ITEM_INT_DATA::ID => {
34171 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
34172 }
34173 MISSION_ITEM_REACHED_DATA::ID => {
34174 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
34175 }
34176 MISSION_REQUEST_DATA::ID => {
34177 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
34178 }
34179 MISSION_REQUEST_INT_DATA::ID => {
34180 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
34181 }
34182 MISSION_REQUEST_LIST_DATA::ID => {
34183 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
34184 }
34185 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
34186 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
34187 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
34188 }
34189 MISSION_SET_CURRENT_DATA::ID => {
34190 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
34191 }
34192 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
34193 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
34194 .map(Self::MISSION_WRITE_PARTIAL_LIST)
34195 }
34196 MOUNT_ORIENTATION_DATA::ID => {
34197 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
34198 }
34199 NAMED_VALUE_FLOAT_DATA::ID => {
34200 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
34201 }
34202 NAMED_VALUE_INT_DATA::ID => {
34203 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
34204 }
34205 NAV_CONTROLLER_OUTPUT_DATA::ID => {
34206 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
34207 }
34208 OBSTACLE_DISTANCE_DATA::ID => {
34209 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
34210 }
34211 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
34212 ONBOARD_COMPUTER_STATUS_DATA::ID => {
34213 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
34214 .map(Self::ONBOARD_COMPUTER_STATUS)
34215 }
34216 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
34217 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
34218 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
34219 }
34220 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
34221 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
34222 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
34223 }
34224 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
34225 .map(Self::OPEN_DRONE_ID_BASIC_ID),
34226 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
34227 .map(Self::OPEN_DRONE_ID_LOCATION),
34228 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
34229 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
34230 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
34231 }
34232 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
34233 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
34234 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
34235 }
34236 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
34237 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
34238 }
34239 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
34240 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
34241 }
34242 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
34243 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
34244 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
34245 }
34246 OPTICAL_FLOW_DATA::ID => {
34247 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
34248 }
34249 OPTICAL_FLOW_RAD_DATA::ID => {
34250 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
34251 }
34252 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
34253 .map(Self::ORBIT_EXECUTION_STATUS),
34254 PARAM_EXT_ACK_DATA::ID => {
34255 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
34256 }
34257 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
34258 .map(Self::PARAM_EXT_REQUEST_LIST),
34259 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
34260 .map(Self::PARAM_EXT_REQUEST_READ),
34261 PARAM_EXT_SET_DATA::ID => {
34262 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
34263 }
34264 PARAM_EXT_VALUE_DATA::ID => {
34265 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
34266 }
34267 PARAM_MAP_RC_DATA::ID => {
34268 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
34269 }
34270 PARAM_REQUEST_LIST_DATA::ID => {
34271 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
34272 }
34273 PARAM_REQUEST_READ_DATA::ID => {
34274 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
34275 }
34276 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
34277 PARAM_VALUE_DATA::ID => {
34278 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
34279 }
34280 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
34281 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
34282 PLAY_TUNE_V2_DATA::ID => {
34283 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
34284 }
34285 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34286 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34287 .map(Self::POSITION_TARGET_GLOBAL_INT)
34288 }
34289 POSITION_TARGET_LOCAL_NED_DATA::ID => {
34290 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34291 .map(Self::POSITION_TARGET_LOCAL_NED)
34292 }
34293 POWER_STATUS_DATA::ID => {
34294 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
34295 }
34296 PROTOCOL_VERSION_DATA::ID => {
34297 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
34298 }
34299 RADIO_STATUS_DATA::ID => {
34300 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
34301 }
34302 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
34303 RAW_PRESSURE_DATA::ID => {
34304 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
34305 }
34306 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
34307 RC_CHANNELS_DATA::ID => {
34308 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
34309 }
34310 RC_CHANNELS_OVERRIDE_DATA::ID => {
34311 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
34312 }
34313 RC_CHANNELS_RAW_DATA::ID => {
34314 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
34315 }
34316 RC_CHANNELS_SCALED_DATA::ID => {
34317 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
34318 }
34319 REQUEST_DATA_STREAM_DATA::ID => {
34320 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
34321 }
34322 REQUEST_EVENT_DATA::ID => {
34323 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
34324 }
34325 RESOURCE_REQUEST_DATA::ID => {
34326 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
34327 }
34328 RESPONSE_EVENT_ERROR_DATA::ID => {
34329 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
34330 }
34331 SAFETY_ALLOWED_AREA_DATA::ID => {
34332 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
34333 }
34334 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
34335 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
34336 .map(Self::SAFETY_SET_ALLOWED_AREA)
34337 }
34338 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
34339 SCALED_IMU2_DATA::ID => {
34340 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
34341 }
34342 SCALED_IMU3_DATA::ID => {
34343 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
34344 }
34345 SCALED_PRESSURE_DATA::ID => {
34346 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
34347 }
34348 SCALED_PRESSURE2_DATA::ID => {
34349 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
34350 }
34351 SCALED_PRESSURE3_DATA::ID => {
34352 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
34353 }
34354 SCRIPT_COUNT_DATA::ID => {
34355 SCRIPT_COUNT_DATA::deser(version, payload).map(Self::SCRIPT_COUNT)
34356 }
34357 SCRIPT_CURRENT_DATA::ID => {
34358 SCRIPT_CURRENT_DATA::deser(version, payload).map(Self::SCRIPT_CURRENT)
34359 }
34360 SCRIPT_ITEM_DATA::ID => {
34361 SCRIPT_ITEM_DATA::deser(version, payload).map(Self::SCRIPT_ITEM)
34362 }
34363 SCRIPT_REQUEST_DATA::ID => {
34364 SCRIPT_REQUEST_DATA::deser(version, payload).map(Self::SCRIPT_REQUEST)
34365 }
34366 SCRIPT_REQUEST_LIST_DATA::ID => {
34367 SCRIPT_REQUEST_LIST_DATA::deser(version, payload).map(Self::SCRIPT_REQUEST_LIST)
34368 }
34369 SERIAL_CONTROL_DATA::ID => {
34370 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
34371 }
34372 SERVO_OUTPUT_RAW_DATA::ID => {
34373 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
34374 }
34375 SETUP_SIGNING_DATA::ID => {
34376 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
34377 }
34378 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
34379 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
34380 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
34381 }
34382 SET_ATTITUDE_TARGET_DATA::ID => {
34383 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
34384 }
34385 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
34386 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
34387 }
34388 SET_HOME_POSITION_DATA::ID => {
34389 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
34390 }
34391 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
34392 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34393 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34394 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
34395 }
34396 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
34397 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34398 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
34399 }
34400 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
34401 SMART_BATTERY_INFO_DATA::ID => {
34402 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
34403 }
34404 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
34405 STORAGE_INFORMATION_DATA::ID => {
34406 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
34407 }
34408 SUPPORTED_TUNES_DATA::ID => {
34409 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
34410 }
34411 SYSTEM_TIME_DATA::ID => {
34412 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
34413 }
34414 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
34415 TERRAIN_CHECK_DATA::ID => {
34416 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
34417 }
34418 TERRAIN_DATA_DATA::ID => {
34419 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
34420 }
34421 TERRAIN_REPORT_DATA::ID => {
34422 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
34423 }
34424 TERRAIN_REQUEST_DATA::ID => {
34425 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
34426 }
34427 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
34428 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
34429 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
34430 .map(Self::TIME_ESTIMATE_TO_TARGET)
34431 }
34432 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34433 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
34434 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
34435 }
34436 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34437 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
34438 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
34439 }
34440 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
34441 UAVCAN_NODE_INFO_DATA::ID => {
34442 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
34443 }
34444 UAVCAN_NODE_STATUS_DATA::ID => {
34445 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
34446 }
34447 UTM_GLOBAL_POSITION_DATA::ID => {
34448 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
34449 }
34450 V2_EXTENSION_DATA::ID => {
34451 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
34452 }
34453 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
34454 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
34455 VICON_POSITION_ESTIMATE_DATA::ID => {
34456 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
34457 .map(Self::VICON_POSITION_ESTIMATE)
34458 }
34459 VIDEO_STREAM_INFORMATION_DATA::ID => {
34460 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
34461 .map(Self::VIDEO_STREAM_INFORMATION)
34462 }
34463 VIDEO_STREAM_STATUS_DATA::ID => {
34464 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
34465 }
34466 VISION_POSITION_ESTIMATE_DATA::ID => {
34467 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34468 .map(Self::VISION_POSITION_ESTIMATE)
34469 }
34470 VISION_SPEED_ESTIMATE_DATA::ID => {
34471 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
34472 }
34473 WHEEL_DISTANCE_DATA::ID => {
34474 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
34475 }
34476 WIFI_CONFIG_AP_DATA::ID => {
34477 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
34478 }
34479 WINCH_STATUS_DATA::ID => {
34480 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
34481 }
34482 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
34483 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
34484 }
34485 }
34486 fn message_name(&self) -> &'static str {
34487 match self {
34488 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
34489 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34490 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
34491 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
34492 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
34493 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
34494 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
34495 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
34496 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
34497 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
34498 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
34499 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34500 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
34501 }
34502 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
34503 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
34504 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
34505 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
34506 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
34507 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
34508 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
34509 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
34510 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
34511 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
34512 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
34513 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
34514 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34515 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34516 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
34517 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
34518 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
34519 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
34520 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
34521 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
34522 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
34523 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34524 Self::COLLISION(..) => COLLISION_DATA::NAME,
34525 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
34526 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
34527 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
34528 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
34529 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
34530 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
34531 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
34532 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
34533 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
34534 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
34535 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
34536 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34537 Self::DEBUG(..) => DEBUG_DATA::NAME,
34538 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
34539 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
34540 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
34541 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
34542 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
34543 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
34544 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
34545 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
34546 Self::EVENT(..) => EVENT_DATA::NAME,
34547 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
34548 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
34549 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
34550 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
34551 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
34552 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
34553 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
34554 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34555 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34556 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34557 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34558 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34559 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34560 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
34561 }
34562 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34563 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
34564 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
34565 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
34566 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34567 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
34568 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
34569 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
34570 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
34571 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
34572 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
34573 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
34574 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
34575 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
34576 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
34577 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
34578 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
34579 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
34580 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
34581 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
34582 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
34583 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
34584 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
34585 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
34586 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
34587 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
34588 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
34589 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
34590 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
34591 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
34592 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
34593 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
34594 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
34595 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
34596 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34597 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
34598 }
34599 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
34600 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
34601 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
34602 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
34603 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
34604 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
34605 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
34606 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
34607 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
34608 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
34609 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
34610 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
34611 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
34612 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
34613 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
34614 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
34615 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
34616 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
34617 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
34618 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
34619 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
34620 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
34621 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
34622 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
34623 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34624 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
34625 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34626 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
34627 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
34628 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
34629 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
34630 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
34631 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
34632 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
34633 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34634 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34635 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34636 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
34637 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34638 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34639 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34640 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34641 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34642 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
34643 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
34644 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
34645 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
34646 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
34647 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
34648 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
34649 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
34650 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
34651 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
34652 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
34653 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
34654 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
34655 Self::PING(..) => PING_DATA::NAME,
34656 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
34657 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
34658 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34659 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
34660 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
34661 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
34662 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
34663 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
34664 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
34665 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
34666 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
34667 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
34668 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
34669 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
34670 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
34671 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
34672 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
34673 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
34674 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
34675 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34676 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
34677 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
34678 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
34679 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
34680 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
34681 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
34682 Self::SCRIPT_COUNT(..) => SCRIPT_COUNT_DATA::NAME,
34683 Self::SCRIPT_CURRENT(..) => SCRIPT_CURRENT_DATA::NAME,
34684 Self::SCRIPT_ITEM(..) => SCRIPT_ITEM_DATA::NAME,
34685 Self::SCRIPT_REQUEST(..) => SCRIPT_REQUEST_DATA::NAME,
34686 Self::SCRIPT_REQUEST_LIST(..) => SCRIPT_REQUEST_LIST_DATA::NAME,
34687 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
34688 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
34689 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
34690 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34691 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
34692 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34693 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
34694 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
34695 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34696 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34697 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
34698 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
34699 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
34700 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
34701 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
34702 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
34703 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
34704 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
34705 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
34706 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
34707 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
34708 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
34709 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34710 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
34711 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
34712 }
34713 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34714 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
34715 }
34716 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
34717 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
34718 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
34719 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
34720 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
34721 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
34722 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
34723 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
34724 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
34725 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
34726 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
34727 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
34728 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34729 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34730 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34731 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34732 }
34733 }
34734 fn message_id(&self) -> u32 {
34735 match self {
34736 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34737 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34738 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34739 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34740 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34741 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34742 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34743 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34744 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34745 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34746 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34747 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34748 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34749 }
34750 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34751 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34752 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34753 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34754 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34755 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34756 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34757 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34758 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34759 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34760 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34761 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34762 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34763 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34764 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34765 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34766 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34767 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34768 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34769 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34770 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34771 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34772 Self::COLLISION(..) => COLLISION_DATA::ID,
34773 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34774 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34775 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34776 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34777 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34778 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34779 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34780 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34781 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34782 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34783 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34784 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34785 Self::DEBUG(..) => DEBUG_DATA::ID,
34786 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34787 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34788 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34789 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34790 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34791 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34792 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34793 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34794 Self::EVENT(..) => EVENT_DATA::ID,
34795 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34796 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34797 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34798 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34799 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34800 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34801 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34802 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34803 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34804 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34805 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34806 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34807 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34808 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34809 }
34810 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34811 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34812 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34813 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34814 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34815 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34816 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34817 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34818 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34819 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34820 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34821 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34822 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34823 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34824 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34825 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34826 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34827 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34828 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34829 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34830 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34831 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34832 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34833 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34834 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34835 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34836 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34837 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34838 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34839 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34840 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34841 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34842 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34843 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34844 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34845 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34846 }
34847 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34848 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34849 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34850 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34851 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34852 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34853 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34854 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34855 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34856 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34857 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34858 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34859 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34860 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34861 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34862 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34863 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34864 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34865 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34866 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34867 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34868 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34869 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34870 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34871 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34872 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34873 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34874 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34875 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34876 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34877 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34878 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34879 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34880 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34881 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34882 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34883 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34884 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34885 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34886 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34887 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34888 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34889 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34890 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34891 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34892 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34893 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34894 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34895 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34896 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34897 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34898 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34899 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34900 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34901 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34902 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34903 Self::PING(..) => PING_DATA::ID,
34904 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34905 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34906 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34907 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34908 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34909 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34910 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34911 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34912 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34913 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34914 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34915 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34916 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34917 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34918 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34919 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34920 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34921 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34922 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34923 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34924 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34925 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34926 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34927 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34928 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34929 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34930 Self::SCRIPT_COUNT(..) => SCRIPT_COUNT_DATA::ID,
34931 Self::SCRIPT_CURRENT(..) => SCRIPT_CURRENT_DATA::ID,
34932 Self::SCRIPT_ITEM(..) => SCRIPT_ITEM_DATA::ID,
34933 Self::SCRIPT_REQUEST(..) => SCRIPT_REQUEST_DATA::ID,
34934 Self::SCRIPT_REQUEST_LIST(..) => SCRIPT_REQUEST_LIST_DATA::ID,
34935 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34936 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34937 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34938 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34939 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34940 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34941 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34942 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34943 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34944 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34945 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34946 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34947 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34948 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34949 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34950 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34951 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34952 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34953 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34954 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34955 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34956 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34957 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34958 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34959 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34960 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34961 }
34962 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34963 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34964 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34965 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34966 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34967 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34968 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34969 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34970 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34971 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34972 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34973 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34974 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34975 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34976 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34977 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34978 }
34979 }
34980 fn message_id_from_name(name: &str) -> Option<u32> {
34981 match name {
34982 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34983 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34984 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34985 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34986 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34987 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34988 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34989 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34990 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34991 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34992 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34993 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34994 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34995 }
34996 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34997 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34998 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34999 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
35000 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
35001 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
35002 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
35003 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
35004 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
35005 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
35006 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
35007 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
35008 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
35009 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
35010 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
35011 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
35012 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
35013 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
35014 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
35015 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
35016 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
35017 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
35018 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
35019 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
35020 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
35021 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
35022 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
35023 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
35024 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
35025 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
35026 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
35027 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
35028 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
35029 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
35030 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
35031 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
35032 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
35033 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
35034 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
35035 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
35036 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
35037 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
35038 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
35039 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
35040 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
35041 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
35042 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
35043 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
35044 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
35045 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
35046 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
35047 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
35048 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
35049 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
35050 }
35051 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
35052 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
35053 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
35054 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
35055 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
35056 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
35057 }
35058 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
35059 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
35060 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
35061 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
35062 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
35063 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
35064 }
35065 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
35066 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
35067 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
35068 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
35069 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
35070 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
35071 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
35072 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
35073 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
35074 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
35075 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
35076 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
35077 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
35078 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
35079 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
35080 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
35081 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
35082 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
35083 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
35084 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
35085 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
35086 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
35087 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
35088 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
35089 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
35090 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
35091 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
35092 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
35093 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
35094 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
35095 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
35096 }
35097 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
35098 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
35099 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
35100 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
35101 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
35102 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
35103 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
35104 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
35105 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
35106 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
35107 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
35108 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
35109 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
35110 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
35111 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
35112 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
35113 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
35114 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
35115 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
35116 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
35117 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
35118 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
35119 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
35120 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
35121 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
35122 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
35123 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
35124 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
35125 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
35126 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
35127 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
35128 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
35129 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
35130 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
35131 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
35132 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
35133 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
35134 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
35135 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
35136 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
35137 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
35138 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
35139 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
35140 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
35141 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
35142 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
35143 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
35144 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
35145 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
35146 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
35147 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
35148 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
35149 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
35150 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
35151 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
35152 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
35153 PING_DATA::NAME => Some(PING_DATA::ID),
35154 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
35155 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
35156 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
35157 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
35158 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
35159 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
35160 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
35161 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
35162 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
35163 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
35164 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
35165 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
35166 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
35167 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
35168 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
35169 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
35170 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
35171 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
35172 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
35173 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
35174 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
35175 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
35176 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
35177 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
35178 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
35179 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
35180 SCRIPT_COUNT_DATA::NAME => Some(SCRIPT_COUNT_DATA::ID),
35181 SCRIPT_CURRENT_DATA::NAME => Some(SCRIPT_CURRENT_DATA::ID),
35182 SCRIPT_ITEM_DATA::NAME => Some(SCRIPT_ITEM_DATA::ID),
35183 SCRIPT_REQUEST_DATA::NAME => Some(SCRIPT_REQUEST_DATA::ID),
35184 SCRIPT_REQUEST_LIST_DATA::NAME => Some(SCRIPT_REQUEST_LIST_DATA::ID),
35185 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
35186 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
35187 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
35188 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
35189 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
35190 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
35191 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
35192 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
35193 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
35194 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
35195 }
35196 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
35197 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
35198 }
35199 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
35200 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
35201 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
35202 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
35203 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
35204 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
35205 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
35206 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
35207 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
35208 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
35209 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
35210 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
35211 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
35212 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
35213 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
35214 }
35215 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
35216 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
35217 }
35218 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
35219 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
35220 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
35221 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
35222 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
35223 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
35224 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
35225 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
35226 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
35227 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
35228 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
35229 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
35230 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
35231 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
35232 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
35233 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
35234 _ => None,
35235 }
35236 }
35237 fn default_message_from_id(id: u32) -> Option<Self> {
35238 match id {
35239 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35240 ACTUATOR_CONTROL_TARGET_DATA::default(),
35241 )),
35242 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35243 ACTUATOR_OUTPUT_STATUS_DATA::default(),
35244 )),
35245 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
35246 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
35247 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
35248 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
35249 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35250 ATTITUDE_QUATERNION_DATA::default(),
35251 )),
35252 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35253 ATTITUDE_QUATERNION_COV_DATA::default(),
35254 )),
35255 ATTITUDE_TARGET_DATA::ID => {
35256 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
35257 }
35258 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
35259 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
35260 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35261 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35262 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
35263 ))
35264 }
35265 AUTOPILOT_VERSION_DATA::ID => {
35266 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
35267 }
35268 AVAILABLE_MODES_DATA::ID => {
35269 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
35270 }
35271 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35272 AVAILABLE_MODES_MONITOR_DATA::default(),
35273 )),
35274 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
35275 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
35276 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
35277 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35278 CAMERA_CAPTURE_STATUS_DATA::default(),
35279 )),
35280 CAMERA_FOV_STATUS_DATA::ID => {
35281 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
35282 }
35283 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35284 CAMERA_IMAGE_CAPTURED_DATA::default(),
35285 )),
35286 CAMERA_INFORMATION_DATA::ID => {
35287 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
35288 }
35289 CAMERA_SETTINGS_DATA::ID => {
35290 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
35291 }
35292 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35293 CAMERA_THERMAL_RANGE_DATA::default(),
35294 )),
35295 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35296 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
35297 )),
35298 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35299 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
35300 )),
35301 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
35302 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
35303 CAN_FILTER_MODIFY_DATA::ID => {
35304 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
35305 }
35306 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
35307 CELLULAR_CONFIG_DATA::ID => {
35308 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
35309 }
35310 CELLULAR_STATUS_DATA::ID => {
35311 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
35312 }
35313 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35314 CHANGE_OPERATOR_CONTROL_DATA::default(),
35315 )),
35316 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35317 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
35318 )),
35319 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
35320 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
35321 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
35322 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
35323 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
35324 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35325 COMPONENT_INFORMATION_DATA::default(),
35326 )),
35327 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35328 COMPONENT_INFORMATION_BASIC_DATA::default(),
35329 )),
35330 COMPONENT_METADATA_DATA::ID => {
35331 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
35332 }
35333 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35334 CONTROL_SYSTEM_STATE_DATA::default(),
35335 )),
35336 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35337 CURRENT_EVENT_SEQUENCE_DATA::default(),
35338 )),
35339 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
35340 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
35341 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35342 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
35343 )),
35344 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
35345 DEBUG_FLOAT_ARRAY_DATA::ID => {
35346 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
35347 }
35348 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
35349 DISTANCE_SENSOR_DATA::ID => {
35350 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
35351 }
35352 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
35353 ENCAPSULATED_DATA_DATA::ID => {
35354 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
35355 }
35356 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
35357 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
35358 ESTIMATOR_STATUS_DATA::ID => {
35359 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
35360 }
35361 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
35362 EXTENDED_SYS_STATE_DATA::ID => {
35363 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
35364 }
35365 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
35366 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35367 FILE_TRANSFER_PROTOCOL_DATA::default(),
35368 )),
35369 FLIGHT_INFORMATION_DATA::ID => {
35370 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
35371 }
35372 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
35373 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
35374 GENERATOR_STATUS_DATA::ID => {
35375 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
35376 }
35377 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35378 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
35379 )),
35380 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35381 GIMBAL_DEVICE_INFORMATION_DATA::default(),
35382 )),
35383 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35384 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
35385 )),
35386 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35387 GIMBAL_MANAGER_INFORMATION_DATA::default(),
35388 )),
35389 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35390 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
35391 )),
35392 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35393 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35394 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
35395 ))
35396 }
35397 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35398 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
35399 )),
35400 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35401 GIMBAL_MANAGER_STATUS_DATA::default(),
35402 )),
35403 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35404 GLOBAL_POSITION_INT_DATA::default(),
35405 )),
35406 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35407 GLOBAL_POSITION_INT_COV_DATA::default(),
35408 )),
35409 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35410 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35411 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
35412 ))
35413 }
35414 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
35415 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
35416 GPS_GLOBAL_ORIGIN_DATA::ID => {
35417 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
35418 }
35419 GPS_INJECT_DATA_DATA::ID => {
35420 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
35421 }
35422 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
35423 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
35424 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
35425 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
35426 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
35427 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
35428 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
35429 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
35430 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
35431 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35432 HIL_ACTUATOR_CONTROLS_DATA::default(),
35433 )),
35434 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
35435 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
35436 HIL_OPTICAL_FLOW_DATA::ID => {
35437 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
35438 }
35439 HIL_RC_INPUTS_RAW_DATA::ID => {
35440 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
35441 }
35442 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
35443 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
35444 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35445 HIL_STATE_QUATERNION_DATA::default(),
35446 )),
35447 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
35448 HYGROMETER_SENSOR_DATA::ID => {
35449 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
35450 }
35451 ILLUMINATOR_STATUS_DATA::ID => {
35452 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
35453 }
35454 ISBD_LINK_STATUS_DATA::ID => {
35455 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
35456 }
35457 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
35458 LINK_NODE_STATUS_DATA::ID => {
35459 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
35460 }
35461 LOCAL_POSITION_NED_DATA::ID => {
35462 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
35463 }
35464 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35465 LOCAL_POSITION_NED_COV_DATA::default(),
35466 )),
35467 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35468 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35469 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
35470 ))
35471 }
35472 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
35473 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
35474 LOGGING_DATA_ACKED_DATA::ID => {
35475 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
35476 }
35477 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
35478 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
35479 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
35480 LOG_REQUEST_DATA_DATA::ID => {
35481 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
35482 }
35483 LOG_REQUEST_END_DATA::ID => {
35484 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
35485 }
35486 LOG_REQUEST_LIST_DATA::ID => {
35487 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
35488 }
35489 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
35490 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
35491 MANUAL_SETPOINT_DATA::ID => {
35492 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
35493 }
35494 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
35495 MESSAGE_INTERVAL_DATA::ID => {
35496 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
35497 }
35498 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
35499 MISSION_CLEAR_ALL_DATA::ID => {
35500 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
35501 }
35502 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
35503 MISSION_CURRENT_DATA::ID => {
35504 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
35505 }
35506 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
35507 MISSION_ITEM_INT_DATA::ID => {
35508 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
35509 }
35510 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35511 MISSION_ITEM_REACHED_DATA::default(),
35512 )),
35513 MISSION_REQUEST_DATA::ID => {
35514 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
35515 }
35516 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35517 MISSION_REQUEST_INT_DATA::default(),
35518 )),
35519 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35520 MISSION_REQUEST_LIST_DATA::default(),
35521 )),
35522 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35523 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
35524 )),
35525 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35526 MISSION_SET_CURRENT_DATA::default(),
35527 )),
35528 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35529 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
35530 )),
35531 MOUNT_ORIENTATION_DATA::ID => {
35532 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
35533 }
35534 NAMED_VALUE_FLOAT_DATA::ID => {
35535 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
35536 }
35537 NAMED_VALUE_INT_DATA::ID => {
35538 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
35539 }
35540 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35541 NAV_CONTROLLER_OUTPUT_DATA::default(),
35542 )),
35543 OBSTACLE_DISTANCE_DATA::ID => {
35544 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
35545 }
35546 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
35547 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35548 ONBOARD_COMPUTER_STATUS_DATA::default(),
35549 )),
35550 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35551 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
35552 )),
35553 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35554 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
35555 )),
35556 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35557 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
35558 )),
35559 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35560 OPEN_DRONE_ID_LOCATION_DATA::default(),
35561 )),
35562 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35563 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
35564 )),
35565 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35566 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
35567 )),
35568 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35569 OPEN_DRONE_ID_SELF_ID_DATA::default(),
35570 )),
35571 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35572 OPEN_DRONE_ID_SYSTEM_DATA::default(),
35573 )),
35574 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35575 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
35576 )),
35577 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
35578 OPTICAL_FLOW_RAD_DATA::ID => {
35579 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
35580 }
35581 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35582 ORBIT_EXECUTION_STATUS_DATA::default(),
35583 )),
35584 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
35585 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35586 PARAM_EXT_REQUEST_LIST_DATA::default(),
35587 )),
35588 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35589 PARAM_EXT_REQUEST_READ_DATA::default(),
35590 )),
35591 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
35592 PARAM_EXT_VALUE_DATA::ID => {
35593 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
35594 }
35595 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
35596 PARAM_REQUEST_LIST_DATA::ID => {
35597 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
35598 }
35599 PARAM_REQUEST_READ_DATA::ID => {
35600 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
35601 }
35602 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
35603 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
35604 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
35605 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
35606 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
35607 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35608 POSITION_TARGET_GLOBAL_INT_DATA::default(),
35609 )),
35610 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35611 POSITION_TARGET_LOCAL_NED_DATA::default(),
35612 )),
35613 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
35614 PROTOCOL_VERSION_DATA::ID => {
35615 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
35616 }
35617 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
35618 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
35619 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
35620 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
35621 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
35622 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35623 RC_CHANNELS_OVERRIDE_DATA::default(),
35624 )),
35625 RC_CHANNELS_RAW_DATA::ID => {
35626 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
35627 }
35628 RC_CHANNELS_SCALED_DATA::ID => {
35629 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
35630 }
35631 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35632 REQUEST_DATA_STREAM_DATA::default(),
35633 )),
35634 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
35635 RESOURCE_REQUEST_DATA::ID => {
35636 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
35637 }
35638 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35639 RESPONSE_EVENT_ERROR_DATA::default(),
35640 )),
35641 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35642 SAFETY_ALLOWED_AREA_DATA::default(),
35643 )),
35644 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35645 SAFETY_SET_ALLOWED_AREA_DATA::default(),
35646 )),
35647 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
35648 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
35649 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
35650 SCALED_PRESSURE_DATA::ID => {
35651 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
35652 }
35653 SCALED_PRESSURE2_DATA::ID => {
35654 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
35655 }
35656 SCALED_PRESSURE3_DATA::ID => {
35657 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
35658 }
35659 SCRIPT_COUNT_DATA::ID => Some(Self::SCRIPT_COUNT(SCRIPT_COUNT_DATA::default())),
35660 SCRIPT_CURRENT_DATA::ID => Some(Self::SCRIPT_CURRENT(SCRIPT_CURRENT_DATA::default())),
35661 SCRIPT_ITEM_DATA::ID => Some(Self::SCRIPT_ITEM(SCRIPT_ITEM_DATA::default())),
35662 SCRIPT_REQUEST_DATA::ID => Some(Self::SCRIPT_REQUEST(SCRIPT_REQUEST_DATA::default())),
35663 SCRIPT_REQUEST_LIST_DATA::ID => Some(Self::SCRIPT_REQUEST_LIST(
35664 SCRIPT_REQUEST_LIST_DATA::default(),
35665 )),
35666 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
35667 SERVO_OUTPUT_RAW_DATA::ID => {
35668 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
35669 }
35670 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
35671 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35672 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
35673 )),
35674 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35675 SET_ATTITUDE_TARGET_DATA::default(),
35676 )),
35677 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35678 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
35679 )),
35680 SET_HOME_POSITION_DATA::ID => {
35681 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
35682 }
35683 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
35684 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35685 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
35686 )),
35687 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35688 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
35689 )),
35690 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
35691 SMART_BATTERY_INFO_DATA::ID => {
35692 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
35693 }
35694 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
35695 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35696 STORAGE_INFORMATION_DATA::default(),
35697 )),
35698 SUPPORTED_TUNES_DATA::ID => {
35699 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
35700 }
35701 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
35702 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
35703 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
35704 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
35705 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
35706 TERRAIN_REQUEST_DATA::ID => {
35707 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
35708 }
35709 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
35710 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35711 TIME_ESTIMATE_TO_TARGET_DATA::default(),
35712 )),
35713 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35714 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35715 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
35716 ))
35717 }
35718 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35719 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35720 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35721 ))
35722 }
35723 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35724 UAVCAN_NODE_INFO_DATA::ID => {
35725 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
35726 }
35727 UAVCAN_NODE_STATUS_DATA::ID => {
35728 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35729 }
35730 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35731 UTM_GLOBAL_POSITION_DATA::default(),
35732 )),
35733 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35734 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
35735 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35736 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35737 VICON_POSITION_ESTIMATE_DATA::default(),
35738 )),
35739 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35740 VIDEO_STREAM_INFORMATION_DATA::default(),
35741 )),
35742 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35743 VIDEO_STREAM_STATUS_DATA::default(),
35744 )),
35745 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35746 VISION_POSITION_ESTIMATE_DATA::default(),
35747 )),
35748 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35749 VISION_SPEED_ESTIMATE_DATA::default(),
35750 )),
35751 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
35752 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
35753 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
35754 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
35755 _ => None,
35756 }
35757 }
35758 #[cfg(feature = "arbitrary")]
35759 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35760 match id {
35761 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35762 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35763 )),
35764 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35765 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35766 )),
35767 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35768 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35769 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35770 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35771 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35772 ATTITUDE_QUATERNION_DATA::random(rng),
35773 )),
35774 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35775 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35776 )),
35777 ATTITUDE_TARGET_DATA::ID => {
35778 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35779 }
35780 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35781 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35782 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35783 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35784 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35785 ))
35786 }
35787 AUTOPILOT_VERSION_DATA::ID => {
35788 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35789 }
35790 AVAILABLE_MODES_DATA::ID => {
35791 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35792 }
35793 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35794 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35795 )),
35796 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35797 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35798 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35799 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35800 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35801 )),
35802 CAMERA_FOV_STATUS_DATA::ID => {
35803 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35804 }
35805 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35806 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35807 )),
35808 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35809 CAMERA_INFORMATION_DATA::random(rng),
35810 )),
35811 CAMERA_SETTINGS_DATA::ID => {
35812 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35813 }
35814 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35815 CAMERA_THERMAL_RANGE_DATA::random(rng),
35816 )),
35817 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35818 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35819 )),
35820 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35821 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35822 )),
35823 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35824 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35825 CAN_FILTER_MODIFY_DATA::ID => {
35826 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35827 }
35828 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35829 CELLULAR_CONFIG_DATA::ID => {
35830 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35831 }
35832 CELLULAR_STATUS_DATA::ID => {
35833 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35834 }
35835 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35836 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35837 )),
35838 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35839 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35840 )),
35841 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35842 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35843 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35844 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35845 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35846 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35847 COMPONENT_INFORMATION_DATA::random(rng),
35848 )),
35849 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35850 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35851 )),
35852 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35853 COMPONENT_METADATA_DATA::random(rng),
35854 )),
35855 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35856 CONTROL_SYSTEM_STATE_DATA::random(rng),
35857 )),
35858 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35859 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35860 )),
35861 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35862 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35863 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35864 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35865 )),
35866 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35867 DEBUG_FLOAT_ARRAY_DATA::ID => {
35868 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35869 }
35870 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35871 DISTANCE_SENSOR_DATA::ID => {
35872 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35873 }
35874 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35875 ENCAPSULATED_DATA_DATA::ID => {
35876 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35877 }
35878 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35879 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35880 ESTIMATOR_STATUS_DATA::ID => {
35881 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35882 }
35883 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35884 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35885 EXTENDED_SYS_STATE_DATA::random(rng),
35886 )),
35887 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35888 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35889 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35890 )),
35891 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35892 FLIGHT_INFORMATION_DATA::random(rng),
35893 )),
35894 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35895 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35896 GENERATOR_STATUS_DATA::ID => {
35897 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35898 }
35899 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35900 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35901 )),
35902 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35903 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35904 )),
35905 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35906 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35907 )),
35908 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35909 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35910 )),
35911 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35912 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35913 )),
35914 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35915 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35916 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35917 ))
35918 }
35919 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35920 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35921 )),
35922 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35923 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35924 )),
35925 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35926 GLOBAL_POSITION_INT_DATA::random(rng),
35927 )),
35928 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35929 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35930 )),
35931 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35932 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35933 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35934 ))
35935 }
35936 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35937 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35938 GPS_GLOBAL_ORIGIN_DATA::ID => {
35939 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35940 }
35941 GPS_INJECT_DATA_DATA::ID => {
35942 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35943 }
35944 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35945 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35946 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35947 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35948 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35949 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35950 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35951 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35952 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35953 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35954 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35955 )),
35956 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35957 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35958 HIL_OPTICAL_FLOW_DATA::ID => {
35959 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35960 }
35961 HIL_RC_INPUTS_RAW_DATA::ID => {
35962 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35963 }
35964 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35965 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35966 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35967 HIL_STATE_QUATERNION_DATA::random(rng),
35968 )),
35969 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35970 HYGROMETER_SENSOR_DATA::ID => {
35971 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35972 }
35973 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35974 ILLUMINATOR_STATUS_DATA::random(rng),
35975 )),
35976 ISBD_LINK_STATUS_DATA::ID => {
35977 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35978 }
35979 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35980 LINK_NODE_STATUS_DATA::ID => {
35981 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35982 }
35983 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35984 LOCAL_POSITION_NED_DATA::random(rng),
35985 )),
35986 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35987 LOCAL_POSITION_NED_COV_DATA::random(rng),
35988 )),
35989 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35990 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35991 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35992 ))
35993 }
35994 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35995 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35996 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35997 LOGGING_DATA_ACKED_DATA::random(rng),
35998 )),
35999 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
36000 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
36001 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
36002 LOG_REQUEST_DATA_DATA::ID => {
36003 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
36004 }
36005 LOG_REQUEST_END_DATA::ID => {
36006 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
36007 }
36008 LOG_REQUEST_LIST_DATA::ID => {
36009 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
36010 }
36011 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
36012 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
36013 MANUAL_SETPOINT_DATA::ID => {
36014 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
36015 }
36016 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
36017 MESSAGE_INTERVAL_DATA::ID => {
36018 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
36019 }
36020 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
36021 MISSION_CLEAR_ALL_DATA::ID => {
36022 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
36023 }
36024 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
36025 MISSION_CURRENT_DATA::ID => {
36026 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
36027 }
36028 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
36029 MISSION_ITEM_INT_DATA::ID => {
36030 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
36031 }
36032 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
36033 MISSION_ITEM_REACHED_DATA::random(rng),
36034 )),
36035 MISSION_REQUEST_DATA::ID => {
36036 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
36037 }
36038 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
36039 MISSION_REQUEST_INT_DATA::random(rng),
36040 )),
36041 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
36042 MISSION_REQUEST_LIST_DATA::random(rng),
36043 )),
36044 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
36045 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
36046 )),
36047 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
36048 MISSION_SET_CURRENT_DATA::random(rng),
36049 )),
36050 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
36051 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
36052 )),
36053 MOUNT_ORIENTATION_DATA::ID => {
36054 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
36055 }
36056 NAMED_VALUE_FLOAT_DATA::ID => {
36057 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
36058 }
36059 NAMED_VALUE_INT_DATA::ID => {
36060 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
36061 }
36062 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
36063 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
36064 )),
36065 OBSTACLE_DISTANCE_DATA::ID => {
36066 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
36067 }
36068 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
36069 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
36070 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
36071 )),
36072 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
36073 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
36074 )),
36075 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
36076 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
36077 )),
36078 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
36079 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
36080 )),
36081 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
36082 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
36083 )),
36084 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
36085 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
36086 )),
36087 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
36088 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
36089 )),
36090 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
36091 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
36092 )),
36093 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
36094 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
36095 )),
36096 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
36097 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
36098 )),
36099 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
36100 OPTICAL_FLOW_RAD_DATA::ID => {
36101 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
36102 }
36103 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
36104 ORBIT_EXECUTION_STATUS_DATA::random(rng),
36105 )),
36106 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
36107 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
36108 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
36109 )),
36110 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
36111 PARAM_EXT_REQUEST_READ_DATA::random(rng),
36112 )),
36113 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
36114 PARAM_EXT_VALUE_DATA::ID => {
36115 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
36116 }
36117 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
36118 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
36119 PARAM_REQUEST_LIST_DATA::random(rng),
36120 )),
36121 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
36122 PARAM_REQUEST_READ_DATA::random(rng),
36123 )),
36124 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
36125 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
36126 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
36127 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
36128 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
36129 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
36130 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
36131 )),
36132 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
36133 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
36134 )),
36135 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
36136 PROTOCOL_VERSION_DATA::ID => {
36137 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
36138 }
36139 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
36140 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
36141 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
36142 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
36143 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
36144 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
36145 RC_CHANNELS_OVERRIDE_DATA::random(rng),
36146 )),
36147 RC_CHANNELS_RAW_DATA::ID => {
36148 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
36149 }
36150 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
36151 RC_CHANNELS_SCALED_DATA::random(rng),
36152 )),
36153 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
36154 REQUEST_DATA_STREAM_DATA::random(rng),
36155 )),
36156 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
36157 RESOURCE_REQUEST_DATA::ID => {
36158 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
36159 }
36160 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
36161 RESPONSE_EVENT_ERROR_DATA::random(rng),
36162 )),
36163 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
36164 SAFETY_ALLOWED_AREA_DATA::random(rng),
36165 )),
36166 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
36167 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
36168 )),
36169 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
36170 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
36171 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
36172 SCALED_PRESSURE_DATA::ID => {
36173 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
36174 }
36175 SCALED_PRESSURE2_DATA::ID => {
36176 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
36177 }
36178 SCALED_PRESSURE3_DATA::ID => {
36179 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
36180 }
36181 SCRIPT_COUNT_DATA::ID => Some(Self::SCRIPT_COUNT(SCRIPT_COUNT_DATA::random(rng))),
36182 SCRIPT_CURRENT_DATA::ID => Some(Self::SCRIPT_CURRENT(SCRIPT_CURRENT_DATA::random(rng))),
36183 SCRIPT_ITEM_DATA::ID => Some(Self::SCRIPT_ITEM(SCRIPT_ITEM_DATA::random(rng))),
36184 SCRIPT_REQUEST_DATA::ID => Some(Self::SCRIPT_REQUEST(SCRIPT_REQUEST_DATA::random(rng))),
36185 SCRIPT_REQUEST_LIST_DATA::ID => Some(Self::SCRIPT_REQUEST_LIST(
36186 SCRIPT_REQUEST_LIST_DATA::random(rng),
36187 )),
36188 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
36189 SERVO_OUTPUT_RAW_DATA::ID => {
36190 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
36191 }
36192 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
36193 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
36194 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
36195 )),
36196 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
36197 SET_ATTITUDE_TARGET_DATA::random(rng),
36198 )),
36199 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
36200 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
36201 )),
36202 SET_HOME_POSITION_DATA::ID => {
36203 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
36204 }
36205 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
36206 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
36207 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
36208 )),
36209 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
36210 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
36211 )),
36212 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
36213 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
36214 SMART_BATTERY_INFO_DATA::random(rng),
36215 )),
36216 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
36217 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
36218 STORAGE_INFORMATION_DATA::random(rng),
36219 )),
36220 SUPPORTED_TUNES_DATA::ID => {
36221 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
36222 }
36223 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
36224 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
36225 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
36226 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
36227 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
36228 TERRAIN_REQUEST_DATA::ID => {
36229 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
36230 }
36231 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
36232 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
36233 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
36234 )),
36235 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36236 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
36237 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
36238 ))
36239 }
36240 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36241 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
36242 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
36243 ))
36244 }
36245 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
36246 UAVCAN_NODE_INFO_DATA::ID => {
36247 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
36248 }
36249 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
36250 UAVCAN_NODE_STATUS_DATA::random(rng),
36251 )),
36252 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
36253 UTM_GLOBAL_POSITION_DATA::random(rng),
36254 )),
36255 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
36256 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
36257 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
36258 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
36259 VICON_POSITION_ESTIMATE_DATA::random(rng),
36260 )),
36261 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
36262 VIDEO_STREAM_INFORMATION_DATA::random(rng),
36263 )),
36264 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
36265 VIDEO_STREAM_STATUS_DATA::random(rng),
36266 )),
36267 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
36268 VISION_POSITION_ESTIMATE_DATA::random(rng),
36269 )),
36270 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
36271 VISION_SPEED_ESTIMATE_DATA::random(rng),
36272 )),
36273 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
36274 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
36275 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
36276 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
36277 _ => None,
36278 }
36279 }
36280 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36281 match self {
36282 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36283 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
36284 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
36285 Self::AIS_VESSEL(body) => body.ser(version, bytes),
36286 Self::ALTITUDE(body) => body.ser(version, bytes),
36287 Self::ATTITUDE(body) => body.ser(version, bytes),
36288 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
36289 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
36290 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
36291 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
36292 Self::AUTH_KEY(body) => body.ser(version, bytes),
36293 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
36294 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
36295 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
36296 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
36297 Self::BATTERY_INFO(body) => body.ser(version, bytes),
36298 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
36299 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
36300 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
36301 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
36302 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
36303 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
36304 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
36305 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
36306 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
36307 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
36308 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
36309 Self::CANFD_FRAME(body) => body.ser(version, bytes),
36310 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
36311 Self::CAN_FRAME(body) => body.ser(version, bytes),
36312 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
36313 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
36314 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
36315 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
36316 Self::COLLISION(body) => body.ser(version, bytes),
36317 Self::COMMAND_ACK(body) => body.ser(version, bytes),
36318 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
36319 Self::COMMAND_INT(body) => body.ser(version, bytes),
36320 Self::COMMAND_LONG(body) => body.ser(version, bytes),
36321 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
36322 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
36323 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
36324 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
36325 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
36326 Self::CURRENT_MODE(body) => body.ser(version, bytes),
36327 Self::DATA_STREAM(body) => body.ser(version, bytes),
36328 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
36329 Self::DEBUG(body) => body.ser(version, bytes),
36330 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
36331 Self::DEBUG_VECT(body) => body.ser(version, bytes),
36332 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
36333 Self::EFI_STATUS(body) => body.ser(version, bytes),
36334 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
36335 Self::ESC_INFO(body) => body.ser(version, bytes),
36336 Self::ESC_STATUS(body) => body.ser(version, bytes),
36337 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
36338 Self::EVENT(body) => body.ser(version, bytes),
36339 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
36340 Self::FENCE_STATUS(body) => body.ser(version, bytes),
36341 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
36342 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
36343 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
36344 Self::FUEL_STATUS(body) => body.ser(version, bytes),
36345 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
36346 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
36347 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
36348 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
36349 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
36350 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
36351 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
36352 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
36353 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
36354 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
36355 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
36356 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36357 Self::GPS2_RAW(body) => body.ser(version, bytes),
36358 Self::GPS2_RTK(body) => body.ser(version, bytes),
36359 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36360 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
36361 Self::GPS_INPUT(body) => body.ser(version, bytes),
36362 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
36363 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
36364 Self::GPS_RTK(body) => body.ser(version, bytes),
36365 Self::GPS_STATUS(body) => body.ser(version, bytes),
36366 Self::HEARTBEAT(body) => body.ser(version, bytes),
36367 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
36368 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
36369 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
36370 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
36371 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
36372 Self::HIL_GPS(body) => body.ser(version, bytes),
36373 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
36374 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
36375 Self::HIL_SENSOR(body) => body.ser(version, bytes),
36376 Self::HIL_STATE(body) => body.ser(version, bytes),
36377 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
36378 Self::HOME_POSITION(body) => body.ser(version, bytes),
36379 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
36380 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
36381 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
36382 Self::LANDING_TARGET(body) => body.ser(version, bytes),
36383 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
36384 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
36385 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
36386 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
36387 Self::LOGGING_ACK(body) => body.ser(version, bytes),
36388 Self::LOGGING_DATA(body) => body.ser(version, bytes),
36389 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
36390 Self::LOG_DATA(body) => body.ser(version, bytes),
36391 Self::LOG_ENTRY(body) => body.ser(version, bytes),
36392 Self::LOG_ERASE(body) => body.ser(version, bytes),
36393 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
36394 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
36395 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
36396 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
36397 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
36398 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
36399 Self::MEMORY_VECT(body) => body.ser(version, bytes),
36400 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
36401 Self::MISSION_ACK(body) => body.ser(version, bytes),
36402 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
36403 Self::MISSION_COUNT(body) => body.ser(version, bytes),
36404 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
36405 Self::MISSION_ITEM(body) => body.ser(version, bytes),
36406 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
36407 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
36408 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
36409 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
36410 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
36411 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
36412 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
36413 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
36414 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
36415 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
36416 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
36417 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
36418 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
36419 Self::ODOMETRY(body) => body.ser(version, bytes),
36420 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
36421 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
36422 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
36423 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
36424 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
36425 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
36426 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
36427 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
36428 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
36429 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
36430 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
36431 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
36432 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
36433 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
36434 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
36435 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
36436 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
36437 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
36438 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
36439 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
36440 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
36441 Self::PARAM_SET(body) => body.ser(version, bytes),
36442 Self::PARAM_VALUE(body) => body.ser(version, bytes),
36443 Self::PING(body) => body.ser(version, bytes),
36444 Self::PLAY_TUNE(body) => body.ser(version, bytes),
36445 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
36446 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36447 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36448 Self::POWER_STATUS(body) => body.ser(version, bytes),
36449 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
36450 Self::RADIO_STATUS(body) => body.ser(version, bytes),
36451 Self::RAW_IMU(body) => body.ser(version, bytes),
36452 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
36453 Self::RAW_RPM(body) => body.ser(version, bytes),
36454 Self::RC_CHANNELS(body) => body.ser(version, bytes),
36455 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
36456 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
36457 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
36458 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
36459 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
36460 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
36461 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
36462 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
36463 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
36464 Self::SCALED_IMU(body) => body.ser(version, bytes),
36465 Self::SCALED_IMU2(body) => body.ser(version, bytes),
36466 Self::SCALED_IMU3(body) => body.ser(version, bytes),
36467 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
36468 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
36469 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
36470 Self::SCRIPT_COUNT(body) => body.ser(version, bytes),
36471 Self::SCRIPT_CURRENT(body) => body.ser(version, bytes),
36472 Self::SCRIPT_ITEM(body) => body.ser(version, bytes),
36473 Self::SCRIPT_REQUEST(body) => body.ser(version, bytes),
36474 Self::SCRIPT_REQUEST_LIST(body) => body.ser(version, bytes),
36475 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
36476 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
36477 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
36478 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36479 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
36480 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36481 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
36482 Self::SET_MODE(body) => body.ser(version, bytes),
36483 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36484 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36485 Self::SIM_STATE(body) => body.ser(version, bytes),
36486 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
36487 Self::STATUSTEXT(body) => body.ser(version, bytes),
36488 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
36489 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
36490 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
36491 Self::SYS_STATUS(body) => body.ser(version, bytes),
36492 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
36493 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
36494 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
36495 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
36496 Self::TIMESYNC(body) => body.ser(version, bytes),
36497 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
36498 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
36499 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
36500 Self::TUNNEL(body) => body.ser(version, bytes),
36501 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
36502 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
36503 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
36504 Self::V2_EXTENSION(body) => body.ser(version, bytes),
36505 Self::VFR_HUD(body) => body.ser(version, bytes),
36506 Self::VIBRATION(body) => body.ser(version, bytes),
36507 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36508 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36509 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
36510 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36511 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
36512 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
36513 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
36514 Self::WINCH_STATUS(body) => body.ser(version, bytes),
36515 Self::WIND_COV(body) => body.ser(version, bytes),
36516 }
36517 }
36518 fn extra_crc(id: u32) -> u8 {
36519 match id {
36520 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36521 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
36522 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
36523 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
36524 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
36525 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
36526 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
36527 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
36528 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
36529 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
36530 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
36531 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36532 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
36533 }
36534 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
36535 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
36536 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
36537 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
36538 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
36539 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
36540 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
36541 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
36542 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
36543 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
36544 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
36545 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
36546 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
36547 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
36548 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
36549 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
36550 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
36551 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
36552 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
36553 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
36554 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
36555 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
36556 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
36557 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
36558 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
36559 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
36560 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
36561 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
36562 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
36563 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
36564 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
36565 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
36566 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
36567 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
36568 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
36569 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
36570 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
36571 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
36572 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
36573 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
36574 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
36575 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
36576 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
36577 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
36578 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
36579 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
36580 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
36581 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
36582 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
36583 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
36584 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
36585 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
36586 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
36587 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
36588 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
36589 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
36590 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
36591 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36592 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
36593 }
36594 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
36595 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
36596 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
36597 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
36598 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36599 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
36600 }
36601 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
36602 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
36603 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36604 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
36605 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
36606 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
36607 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
36608 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
36609 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
36610 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
36611 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
36612 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
36613 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
36614 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
36615 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
36616 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
36617 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
36618 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
36619 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
36620 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
36621 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
36622 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
36623 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
36624 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
36625 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
36626 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
36627 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
36628 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
36629 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
36630 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36631 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
36632 }
36633 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
36634 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
36635 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
36636 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
36637 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
36638 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
36639 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
36640 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
36641 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
36642 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
36643 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
36644 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
36645 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
36646 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
36647 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
36648 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
36649 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
36650 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
36651 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
36652 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
36653 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
36654 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
36655 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
36656 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
36657 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
36658 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
36659 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
36660 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
36661 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
36662 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
36663 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
36664 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
36665 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
36666 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
36667 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
36668 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
36669 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
36670 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
36671 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
36672 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
36673 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
36674 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
36675 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
36676 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
36677 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
36678 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
36679 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
36680 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
36681 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
36682 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
36683 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
36684 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
36685 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
36686 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
36687 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
36688 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
36689 PING_DATA::ID => PING_DATA::EXTRA_CRC,
36690 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
36691 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
36692 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
36693 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36694 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
36695 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
36696 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
36697 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
36698 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
36699 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
36700 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
36701 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
36702 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
36703 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
36704 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
36705 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
36706 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
36707 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
36708 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36709 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36710 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36711 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36712 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36713 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36714 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36715 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36716 SCRIPT_COUNT_DATA::ID => SCRIPT_COUNT_DATA::EXTRA_CRC,
36717 SCRIPT_CURRENT_DATA::ID => SCRIPT_CURRENT_DATA::EXTRA_CRC,
36718 SCRIPT_ITEM_DATA::ID => SCRIPT_ITEM_DATA::EXTRA_CRC,
36719 SCRIPT_REQUEST_DATA::ID => SCRIPT_REQUEST_DATA::EXTRA_CRC,
36720 SCRIPT_REQUEST_LIST_DATA::ID => SCRIPT_REQUEST_LIST_DATA::EXTRA_CRC,
36721 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36722 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36723 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36724 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36725 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36726 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36727 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36728 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36729 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36730 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36731 }
36732 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36733 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36734 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36735 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36736 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36737 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36738 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36739 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36740 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36741 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36742 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36743 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36744 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36745 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36746 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36747 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36748 }
36749 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36750 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36751 }
36752 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36753 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36754 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36755 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36756 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36757 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36758 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36759 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36760 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36761 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36762 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36763 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36764 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36765 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36766 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36767 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36768 _ => 0,
36769 }
36770 }
36771 fn target_system_id(&self) -> Option<u8> {
36772 match self {
36773 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36774 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36775 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36776 Self::CAN_FRAME(inner) => Some(inner.target_system),
36777 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36778 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36779 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36780 Self::COMMAND_INT(inner) => Some(inner.target_system),
36781 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36782 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36783 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36784 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36785 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36786 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36787 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36788 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36789 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36790 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36791 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36792 Self::LOG_ERASE(inner) => Some(inner.target_system),
36793 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36794 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36795 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36796 Self::MISSION_ACK(inner) => Some(inner.target_system),
36797 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36798 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36799 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36800 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36801 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36802 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36803 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36804 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36805 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36806 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36807 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36808 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36809 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36810 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36811 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36812 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36813 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36814 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36815 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36816 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36817 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36818 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36819 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36820 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36821 Self::PARAM_SET(inner) => Some(inner.target_system),
36822 Self::PING(inner) => Some(inner.target_system),
36823 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36824 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36825 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36826 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36827 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36828 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36829 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36830 Self::SCRIPT_COUNT(inner) => Some(inner.target_system),
36831 Self::SCRIPT_ITEM(inner) => Some(inner.target_system),
36832 Self::SCRIPT_REQUEST(inner) => Some(inner.target_system),
36833 Self::SCRIPT_REQUEST_LIST(inner) => Some(inner.target_system),
36834 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36835 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36836 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36837 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36838 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36839 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36840 Self::SET_MODE(inner) => Some(inner.target_system),
36841 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36842 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36843 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36844 Self::TIMESYNC(inner) => Some(inner.target_system),
36845 Self::TUNNEL(inner) => Some(inner.target_system),
36846 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36847 _ => None,
36848 }
36849 }
36850 fn target_component_id(&self) -> Option<u8> {
36851 match self {
36852 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36853 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36854 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36855 Self::CAN_FRAME(inner) => Some(inner.target_component),
36856 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36857 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36858 Self::COMMAND_INT(inner) => Some(inner.target_component),
36859 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36860 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36861 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36862 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36863 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36864 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36865 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36866 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36867 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36868 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36869 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36870 Self::LOG_ERASE(inner) => Some(inner.target_component),
36871 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36872 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36873 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36874 Self::MISSION_ACK(inner) => Some(inner.target_component),
36875 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36876 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36877 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36878 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36879 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36880 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36881 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36882 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36883 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36884 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36885 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36886 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36887 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36888 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36889 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36890 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36891 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36892 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36893 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36894 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36895 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36896 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36897 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36898 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36899 Self::PARAM_SET(inner) => Some(inner.target_component),
36900 Self::PING(inner) => Some(inner.target_component),
36901 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36902 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36903 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36904 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36905 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36906 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36907 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36908 Self::SCRIPT_COUNT(inner) => Some(inner.target_component),
36909 Self::SCRIPT_ITEM(inner) => Some(inner.target_component),
36910 Self::SCRIPT_REQUEST(inner) => Some(inner.target_component),
36911 Self::SCRIPT_REQUEST_LIST(inner) => Some(inner.target_component),
36912 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36913 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36914 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36915 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36916 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36917 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36918 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36919 Self::TIMESYNC(inner) => Some(inner.target_component),
36920 Self::TUNNEL(inner) => Some(inner.target_component),
36921 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36922 _ => None,
36923 }
36924 }
36925}